diff options
author | Simon Rettberg | 2022-05-12 17:54:56 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-05-12 17:54:56 +0200 |
commit | 04fb71b76df10bca9d75846aad32796023252aa1 (patch) | |
tree | b7bd2ac41a4ed9de90dc535e5228518f37b248d4 /inc/hook.inc.php | |
parent | [inc/Download] Add types (diff) | |
download | slx-admin-04fb71b76df10bca9d75846aad32796023252aa1.tar.gz slx-admin-04fb71b76df10bca9d75846aad32796023252aa1.tar.xz slx-admin-04fb71b76df10bca9d75846aad32796023252aa1.zip |
[inc/Hook] Add types
Diffstat (limited to 'inc/hook.inc.php')
-rw-r--r-- | inc/hook.inc.php | 5 |
1 files changed, 3 insertions, 2 deletions
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; |