From e7c7d5c63f5c2d7daeea0741dc60c4e781aa46a5 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 20 Aug 2024 10:37:44 +0800 Subject: [PATCH] Update constructor usage of call_user_func_array Ignore phpcompat errors as they do not impact us in this case Also do not return the alue of the `call_user_func_array`, but return a void value. Fixes #104 --- src/Html2Text.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Html2Text.php b/src/Html2Text.php index e33caa4..6e0f9e5 100644 --- a/src/Html2Text.php +++ b/src/Html2Text.php @@ -242,7 +242,9 @@ public function __construct($html = '', $options = array()) // for backwards compatibility if (!is_array($options)) { - return call_user_func_array(array($this, 'legacyConstruct'), func_get_args()); + // phpcs:ignore (PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection + call_user_func_array(array($this, 'legacyConstruct'), func_get_args()); + return; } $this->html = $html;