Skip to content

Commit

Permalink
Fixes type for SMF\IntegrationHook::$name
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Nov 6, 2024
1 parent cde30d6 commit 45c2104
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Sources/IntegrationHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class IntegrationHook
*******************/

/**
* @var array
* @var string
*
* The name of this integration hook.
*/
public array $name;
public string $name;

/**
* @var bool
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 45c2104

Please sign in to comment.