triggerFilter -> pass by reference (faster x5)

This commit is contained in:
slawkens
2025-05-08 18:34:36 +02:00
parent 99997eb57d
commit 5b4b7b8a97
4 changed files with 5 additions and 7 deletions

View File

@@ -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 {