From dca2ae60a1c7a7951ee769aefeb19c4576c57aa6 Mon Sep 17 00:00:00 2001 From: wn_ Date: Tue, 12 Nov 2024 03:38:45 +0000 Subject: Remove some PHPStan ignores and make others rule-specific. --- classes/PluginHost.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'classes/PluginHost.php') diff --git a/classes/PluginHost.php b/classes/PluginHost.php index 88eb5d2a4..b54e48d4f 100644 --- a/classes/PluginHost.php +++ b/classes/PluginHost.php @@ -386,8 +386,7 @@ class PluginHost { * @param PluginHost::HOOK_* $type */ function del_hook(string $type, Plugin $sender): void { - /** @phpstan-ignore function.alreadyNarrowedType ($type might not exist) */ - if (is_array($this->hooks[$type])) { + if (array_key_exists($type, $this->hooks)) { foreach (array_keys($this->hooks[$type]) as $prio) { $key = array_search($sender, $this->hooks[$type][$prio]); -- cgit v1.2.3-54-g00ecf