Merge "Put wfDeprecated() on obsolete use of $wgSpecialPages"
[lhc/web/wiklou.git] / includes / api / ApiModuleManager.php
index 100392b..8226529 100644 (file)
  */
 class ApiModuleManager extends ContextSource {
 
+       /**
+        * @var ApiBase
+        */
        private $mParent;
+       /**
+        * @var ApiBase[]
+        */
        private $mInstances = array();
+       /**
+        * @var null[]
+        */
        private $mGroups = array();
+       /**
+        * @var array[]
+        */
        private $mModules = array();
 
        /**
@@ -73,10 +85,10 @@ 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 bool $ignoreCache if true, force-creates a new instance and does not cache it
-        * @return mixed the new module instance, or null if failed
+        * @param string $moduleName Module name
+        * @param string $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 mixed The new module instance, or null if failed
         */
        public function getModule( $moduleName, $group = null, $ignoreCache = false ) {
                if ( !isset( $this->mModules[$moduleName] ) ) {
@@ -97,14 +109,15 @@ class ApiModuleManager extends ContextSource {
                                // cache this instance in case it is needed later
                                $this->mInstances[$moduleName] = $instance;
                        }
+
                        return $instance;
                }
        }
 
        /**
         * Get an array of modules in a specific group or all if no group is set.
-        * @param string $group optional group filter
-        * @return array list of module names
+        * @param string $group Optional group filter
+        * @return array List of module names
         */
        public function getNames( $group = null ) {
                if ( $group === null ) {
@@ -116,13 +129,14 @@ class ApiModuleManager extends ContextSource {
                                $result[] = $name;
                        }
                }
+
                return $result;
        }
 
        /**
         * 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
-        * @return array name=>class map
+        * @param string $group Name of the group to get or null for all
+        * @return array Name=>class map
         */
        public function getNamesWithClasses( $group = null ) {
                $result = array();
@@ -131,34 +145,35 @@ class ApiModuleManager extends ContextSource {
                                $result[$name] = $grpCls[1];
                        }
                }
+
                return $result;
        }
 
        /**
         * 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,
-        * @return boolean true if defined
+        * @param string $moduleName Module name
+        * @param string $group Group name to check against, or null to check all groups,
+        * @return bool True if defined
         */
        public function isDefined( $moduleName, $group = null ) {
                if ( isset( $this->mModules[$moduleName] ) ) {
                        return $group === null || $this->mModules[$moduleName][0] === $group;
-               } else {
-                       return false;
                }
+
+               return false;
        }
 
        /**
         * Returns the group name for the given module
         * @param string $moduleName
-        * @return string group name or null if missing
+        * @return string Group name or null if missing
         */
        public function getModuleGroup( $moduleName ) {
                if ( isset( $this->mModules[$moduleName] ) ) {
                        return $this->mModules[$moduleName][0];
-               } else {
-                       return null;
                }
+
+               return null;
        }
 
        /**