diff options
Diffstat (limited to 'inc/hook.inc.php')
-rw-r--r-- | inc/hook.inc.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/hook.inc.php b/inc/hook.inc.php index f74281f1..abeac68e 100644 --- a/inc/hook.inc.php +++ b/inc/hook.inc.php @@ -14,7 +14,7 @@ class Hook * * @param string $hookName Name of hook to search for. * @param bool $filterBroken if true, modules that have a hook but have missing deps will not be returned - * @return \Hook[] list of modules with requested hooks + * @return Hook[] list of modules with requested hooks */ public static function load(string $hookName, bool $filterBroken = true): array { @@ -34,17 +34,17 @@ class Hook * @param string $moduleName Module * @param string $hookName Hook * @param bool $filterBroken return false if the module has missing deps - * @return Hook|false hook instance, false on error or if module doesn't have given hook + * @return ?Hook hook instance, false on error or if module doesn't have given hook */ - public static function loadSingle(string $moduleName, string $hookName, bool $filterBroken = true) + public static function loadSingle(string $moduleName, string $hookName, bool $filterBroken = true): ?Hook { if (Module::get($moduleName) === false) // No such module - return false; + return null; if ($filterBroken && !Module::isAvailable($moduleName)) // Broken - return false; + return null; $file = 'modules/' . $moduleName . '/hooks/' . $hookName . '.inc.php'; if (!file_exists($file)) // No hook - return false; + return null; return new Hook($moduleName, $file); } |