From 45c2104b8ebe77f823093e69a1c6c9fc99711559 Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Wed, 6 Nov 2024 13:37:40 -0700 Subject: [PATCH] Fixes type for SMF\IntegrationHook::$name Signed-off-by: Jon Stovell --- Sources/IntegrationHook.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Sources/IntegrationHook.php b/Sources/IntegrationHook.php index 2444db6f93..088223dfd7 100644 --- a/Sources/IntegrationHook.php +++ b/Sources/IntegrationHook.php @@ -27,11 +27,11 @@ class IntegrationHook *******************/ /** - * @var array + * @var string * * The name of this integration hook. */ - public array $name; + public string $name; /** * @var bool @@ -75,17 +75,19 @@ public function __construct(string $name, ?bool $ignore_errors = null) return; } + $this->name = $name; + $this->ignore_errors = $ignore_errors ?? !empty(Utils::$context['ignore_hook_errors']); if (!empty(Config::$db_show_debug)) { - Utils::$context['debug']['hooks'][] = $name; + Utils::$context['debug']['hooks'][] = $this->name; } - if (empty(Config::$modSettings[$name])) { + if (empty(Config::$modSettings[$this->name])) { return; } - $func_strings = explode(',', Config::$modSettings[$name]); + $func_strings = explode(',', Config::$modSettings[$this->name]); // Loop through each one to get the callable for it. foreach ($func_strings as $func_string) {