Merge "Revert "filebackend: cleaned up the FileBackend constructor""
[lhc/web/wiklou.git] / includes / filebackend / FileBackendGroup.php
index be8a207..491424b 100644 (file)
  * @since 1.19
  */
 class FileBackendGroup {
-       /**
-        * @var FileBackendGroup
-        */
+       /** @var FileBackendGroup */
        protected static $instance = null;
 
-       /** @var Array (name => ('class' => string, 'config' => array, 'instance' => object)) */
+       /** @var array (name => ('class' => string, 'config' => array, 'instance' => object)) */
        protected $backends = array();
 
-       protected function __construct() {}
+       protected function __construct() {
+       }
 
        /**
         * @return FileBackendGroup
@@ -47,13 +46,12 @@ class FileBackendGroup {
                        self::$instance = new self();
                        self::$instance->initFromGlobals();
                }
+
                return self::$instance;
        }
 
        /**
         * Destroy the singleton instance
-        *
-        * @return void
         */
        public static function destroySingleton() {
                self::$instance = null;
@@ -61,8 +59,6 @@ class FileBackendGroup {
 
        /**
         * Register file backends from the global variables
-        *
-        * @return void
         */
        protected function initFromGlobals() {
                global $wgLocalFileRepo, $wgForeignFileRepos, $wgFileBackends;
@@ -116,8 +112,7 @@ class FileBackendGroup {
        /**
         * Register an array of file backend configurations
         *
-        * @param Array $configs
-        * @return void
+        * @param array $configs
         * @throws MWException
         */
        protected function register( array $configs ) {
@@ -159,6 +154,7 @@ class FileBackendGroup {
                        $config = $this->backends[$name]['config'];
                        $this->backends[$name]['instance'] = new $class( $config );
                }
+
                return $this->backends[$name]['instance'];
        }
 
@@ -166,7 +162,7 @@ class FileBackendGroup {
         * Get the config array for a backend object with a given name
         *
         * @param string $name
-        * @return Array
+        * @return array
         * @throws MWException
         */
        public function config( $name ) {
@@ -174,6 +170,7 @@ class FileBackendGroup {
                        throw new MWException( "No backend defined with the name `$name`." );
                }
                $class = $this->backends[$name]['class'];
+
                return array( 'class' => $class ) + $this->backends[$name]['config'];
        }
 
@@ -188,6 +185,7 @@ class FileBackendGroup {
                if ( $backend !== null && isset( $this->backends[$backend] ) ) {
                        return $this->get( $backend );
                }
+
                return null;
        }
 }