diff --git a/system/functions.php b/system/functions.php index c3fd4199..6e58ca9d 100644 --- a/system/functions.php +++ b/system/functions.php @@ -575,7 +575,7 @@ function template_footer(): string $footer[] = base64_decode('UG93ZXJlZCBieSA8YSBocmVmPSJodHRwOi8vbXktYWFjLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPk15QUFDLjwvYT4='); global $hooks; - $footer = $hooks->triggerFilter(HOOK_FILTER_THEME_FOOTER, $footer); + $hooks->triggerFilter(HOOK_FILTER_THEME_FOOTER, $footer); return implode('
', $footer); } diff --git a/system/src/Hook.php b/system/src/Hook.php index 9f4b7978..161b2ffc 100644 --- a/system/src/Hook.php +++ b/system/src/Hook.php @@ -37,7 +37,7 @@ class Hook return !isset($ret) || $ret == 1 || $ret; } - public function executeFilter(...$args) { + public function executeFilter(&$args) { return include BASE . $this->_file; } diff --git a/system/src/Hooks.php b/system/src/Hooks.php index 084d5e1a..a7d6cb3a 100644 --- a/system/src/Hooks.php +++ b/system/src/Hooks.php @@ -30,7 +30,7 @@ class Hooks return $ret; } - public function triggerFilter($type, $args = []) + public function triggerFilter($type, &...$args) { if(isset(self::$_hooks[$type])) { foreach(self::$_hooks[$type] as $hook) { @@ -38,8 +38,6 @@ class Hooks $args = $hook->executeFilter(...$args); } } - - return $args; } public function exist($type): bool { diff --git a/system/src/Twig/EnvironmentBridge.php b/system/src/Twig/EnvironmentBridge.php index ab54bd25..4b8423f8 100644 --- a/system/src/Twig/EnvironmentBridge.php +++ b/system/src/Twig/EnvironmentBridge.php @@ -11,7 +11,7 @@ class EnvironmentBridge extends Environment global $hooks; $context['viewName'] = $name; - $context = $hooks->triggerFilter(HOOK_FILTER_TWIG_DISPLAY, $context); + $hooks->triggerFilter(HOOK_FILTER_TWIG_DISPLAY, $context); parent::display($name, $context); } @@ -21,7 +21,7 @@ class EnvironmentBridge extends Environment global $hooks; $context['viewName'] = $name; - $context = $hooks->triggerFilter(HOOK_FILTER_TWIG_RENDER, $context); + $hooks->triggerFilter(HOOK_FILTER_TWIG_RENDER, $context); return parent::render($name, $context); }