diff options
Diffstat (limited to 'src/HookManager.php')
-rw-r--r-- | src/HookManager.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/HookManager.php b/src/HookManager.php index 0f252c8..215ff58 100644 --- a/src/HookManager.php +++ b/src/HookManager.php @@ -19,7 +19,7 @@ class HookManager public function doAction(string $name, mixed ...$arguments): void { - foreach ($this->actions[$name] as $actions) { + foreach ($this->actions[$name] ?? [] as $actions) { foreach ($actions as $action) { call_user_func_array($action['function'], $arguments); } @@ -31,7 +31,7 @@ class HookManager // set $value as first argument array_unshift($arguments, $value); - foreach ($this->filters[$name] as $filters) { + foreach ($this->filters[$name] ?? [] as $filters) { foreach ($filters as $filter) { $value = call_user_func_array($filter['function'], $arguments); } |