From 1334236bb6059b2302a760196ce7885df379e984 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 6 Mar 2022 11:45:31 +0100 Subject: toml to yaml --- src/HookManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/HookManager.php') 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); } -- cgit v1.2.3