X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiModuleManager.php;h=d2df013c088bd0988dd2c03228d7965fb5036b48;hb=616525021b3691e30a980a42b837b7ad44ecfd09;hp=e02c862778a1a2016793f5007ab374b66185dcbd;hpb=0c2687f44eb0e8c7f480b7303f89056682ba0bfb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiModuleManager.php b/includes/api/ApiModuleManager.php index e02c862778..d2df013c08 100644 --- a/includes/api/ApiModuleManager.php +++ b/includes/api/ApiModuleManager.php @@ -96,7 +96,7 @@ class ApiModuleManager extends ContextSource { foreach ( $modules as $name => $moduleSpec ) { if ( is_array( $moduleSpec ) ) { $class = $moduleSpec['class']; - $factory = ( isset( $moduleSpec['factory'] ) ? $moduleSpec['factory'] : null ); + $factory = ( $moduleSpec['factory'] ?? null ); } else { $class = $moduleSpec; $factory = null; @@ -143,7 +143,7 @@ class ApiModuleManager extends ContextSource { * Get module instance by name, or instantiate it if it does not exist * * @param string $moduleName Module name - * @param string $group Optionally validate that the module is in a specific group + * @param string|null $group Optionally validate that the module is in a specific group * @param bool $ignoreCache If true, force-creates a new instance and does not cache it * * @return ApiBase|null The new module instance, or null if failed @@ -205,7 +205,7 @@ class ApiModuleManager extends ContextSource { /** * Get an array of modules in a specific group or all if no group is set. - * @param string $group Optional group filter + * @param string|null $group Optional group filter * @return array List of module names */ public function getNames( $group = null ) { @@ -224,7 +224,7 @@ class ApiModuleManager extends ContextSource { /** * Create an array of (moduleName => moduleClass) for a specific group or for all. - * @param string $group Name of the group to get or null for all + * @param string|null $group Name of the group to get or null for all * @return array Name=>class map */ public function getNamesWithClasses( $group = null ) { @@ -256,7 +256,7 @@ class ApiModuleManager extends ContextSource { /** * Returns true if the specific module is defined at all or in a specific group. * @param string $moduleName Module name - * @param string $group Group name to check against, or null to check all groups, + * @param string|null $group Group name to check against, or null to check all groups, * @return bool True if defined */ public function isDefined( $moduleName, $group = null ) {