From 04fb71b76df10bca9d75846aad32796023252aa1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 12 May 2022 17:54:56 +0200 Subject: [inc/Hook] Add types --- inc/hook.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'inc/hook.inc.php') diff --git a/inc/hook.inc.php b/inc/hook.inc.php index 05078f72..f74281f1 100644 --- a/inc/hook.inc.php +++ b/inc/hook.inc.php @@ -11,11 +11,12 @@ class Hook * Internally, this scans for "modules/<*>/hooks/$hookName.inc.php" * and optionally checks if the module's dependencies are fulfilled, * then returns a list of all matching modules. + * * @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 */ - public static function load($hookName, $filterBroken = true) + public static function load(string $hookName, bool $filterBroken = true): array { $retval = array(); foreach (glob('modules/*/hooks/' . $hookName . '.inc.php', GLOB_NOSORT) as $file) { @@ -35,7 +36,7 @@ class 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 */ - public static function loadSingle($moduleName, $hookName, $filterBroken = true) + public static function loadSingle(string $moduleName, string $hookName, bool $filterBroken = true) { if (Module::get($moduleName) === false) // No such module return false; -- cgit v1.2.3-55-g7522