Merge "Correct variable names in @param to match method declarations"
[lhc/web/wiklou.git] / includes / filerepo / RepoGroup.php
index 18432a1..189c3a3 100644 (file)
@@ -90,7 +90,7 @@ class RepoGroup {
         * Construct a group of file repositories.
         *
         * @param array $localInfo Associative array for local repo's info
-        * @param array $foreignInfo of repository info arrays.
+        * @param array $foreignInfo Array of repository info arrays.
         *   Each info array is an associative array with the 'class' member
         *   giving the class name. The entire array is passed to the repository
         *   constructor as the first parameter.
@@ -105,7 +105,7 @@ class RepoGroup {
         * Search repositories for an image.
         * You can also use wfFindFile() to do this.
         *
-        * @param $title Title|string Title object or string
+        * @param Title|string $title Title object or string
         * @param array $options Associative array of options:
         *   time:           requested time for an archived image, or false for the
         *                   current version. An image object will be returned which was
@@ -185,7 +185,7 @@ class RepoGroup {
         * @return array Map of (file name => File objects) for matches
         *
         * @param array $inputItems
-        * @param integer $flags
+        * @param int $flags
         * @return array
         */
        function findFiles( array $inputItems, $flags = 0 ) {
@@ -220,8 +220,8 @@ class RepoGroup {
 
        /**
         * Interface for FileRepo::checkRedirect()
-        * @param $title Title
-        * @return bool
+        * @param Title $title
+        * @return bool|Title
         */
        function checkRedirect( Title $title ) {
                if ( !$this->reposInitialised ) {
@@ -247,9 +247,9 @@ class RepoGroup {
         * Find an instance of the file with this key, created at the specified time
         * Returns false if the file does not exist.
         *
-        * @param string $hash base 36 SHA-1 hash
+        * @param string $hash Base 36 SHA-1 hash
         * @param array $options Option array, same as findFile()
-        * @return File object or false if it is not found
+        * @return File|bool File object or false if it is not found
         */
        function findFileFromKey( $hash, $options = array() ) {
                if ( !$this->reposInitialised ) {
@@ -272,8 +272,8 @@ class RepoGroup {
        /**
         * Find all instances of files with this key
         *
-        * @param string $hash base 36 SHA-1 hash
-        * @return Array of File objects
+        * @param string $hash Base 36 SHA-1 hash
+        * @return File[]
         */
        function findBySha1( $hash ) {
                if ( !$this->reposInitialised ) {
@@ -292,8 +292,8 @@ class RepoGroup {
        /**
         * Find all instances of files with this keys
         *
-        * @param array $hashes base 36 SHA-1 hashes
-        * @return array of array of File objects
+        * @param array $hashes Base 36 SHA-1 hashes
+        * @return array Array of array of File objects
         */
        function findBySha1s( array $hashes ) {
                if ( !$this->reposInitialised ) {
@@ -367,6 +367,9 @@ class RepoGroup {
         * @return bool
         */
        function forEachForeignRepo( $callback, $params = array() ) {
+               if ( !$this->reposInitialised ) {
+                       $this->initialiseRepos();
+               }
                foreach ( $this->foreignRepos as $repo ) {
                        $args = array_merge( array( $repo ), $params );
                        if ( call_user_func_array( $callback, $args ) ) {
@@ -382,6 +385,9 @@ class RepoGroup {
         * @return bool
         */
        function hasForeignRepos() {
+               if ( !$this->reposInitialised ) {
+                       $this->initialiseRepos();
+               }
                return (bool)$this->foreignRepos;
        }
 
@@ -414,7 +420,7 @@ class RepoGroup {
         * Split a virtual URL into repo, zone and rel parts
         * @param string $url
         * @throws MWException
-        * @return array containing repo, zone and rel
+        * @return array Containing repo, zone and rel
         */
        function splitVirtualUrl( $url ) {
                if ( substr( $url, 0, 9 ) != 'mwrepo://' ) {