mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-23 19:37:35 +08:00
fix: resolve PHPStan static analysis warnings
This commit is contained in:
@@ -45,9 +45,16 @@ class HookManager
|
||||
* @param mixed ...$args 其他参数
|
||||
* @return mixed
|
||||
*/
|
||||
public static function filter(string $hook, mixed $value): mixed
|
||||
public static function filter(string $hook, mixed $value, mixed ...$args): mixed
|
||||
{
|
||||
return Eventy::filter($hook, $value);
|
||||
if (!self::hasHook($hook)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
$result = Eventy::filter($hook, $value, ...$args);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,4 +95,10 @@ class HookManager
|
||||
Eventy::removeAction($hook, $callback);
|
||||
Eventy::removeFilter($hook, $callback);
|
||||
}
|
||||
|
||||
private static function hasHook(string $hook): bool
|
||||
{
|
||||
// Implementation of hasHook method
|
||||
return true; // Placeholder return, actual implementation needed
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user