Create a Special:Redirect page.
[lhc/web/wiklou.git] / includes / filerepo / RepoGroup.php
index 1f5ae91..b2b9477 100644 (file)
@@ -79,8 +79,8 @@ class RepoGroup {
        /**
         * Construct a group of file repositories.
         *
-        * @param $localInfo array Associative array for local repo's info
-        * @param $foreignInfo Array of repository info arrays.
+        * @param array $localInfo Associative array for local repo's info
+        * @param array $foreignInfo 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.
@@ -96,7 +96,7 @@ class RepoGroup {
         * You can also use wfFindFile() to do this.
         *
         * @param $title Title|string Title object or string
-        * @param $options array Associative array of options:
+        * @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
         *                     created at the specified time.
@@ -209,7 +209,7 @@ class RepoGroup {
                }
 
                $redir = $this->localRepo->checkRedirect( $title );
-               if( $redir ) {
+               if ( $redir ) {
                        return $redir;
                }
                foreach ( $this->foreignRepos as $repo ) {
@@ -225,8 +225,8 @@ 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 $hash String base 36 SHA-1 hash
-        * @param $options array Option array, same as findFile()
+        * @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
         */
        function findFileFromKey( $hash, $options = array() ) {
@@ -238,7 +238,9 @@ class RepoGroup {
                if ( !$file ) {
                        foreach ( $this->foreignRepos as $repo ) {
                                $file = $repo->findFileFromKey( $hash, $options );
-                               if ( $file ) break;
+                               if ( $file ) {
+                                       break;
+                               }
                        }
                }
                return $file;
@@ -247,7 +249,7 @@ class RepoGroup {
        /**
         * Find all instances of files with this key
         *
-        * @param $hash String base 36 SHA-1 hash
+        * @param string $hash base 36 SHA-1 hash
         * @return Array of File objects
         */
        function findBySha1( $hash ) {
@@ -266,7 +268,7 @@ class RepoGroup {
        /**
         * Find all instances of files with this keys
         *
-        * @param $hashes Array base 36 SHA-1 hashes
+        * @param array $hashes base 36 SHA-1 hashes
         * @return Array of array of File objects
         */
        function findBySha1s( array $hashes ) {
@@ -279,7 +281,7 @@ class RepoGroup {
                        $result = array_merge_recursive( $result, $repo->findBySha1s( $hashes ) );
                }
                //sort the merged (and presorted) sublist of each hash
-               foreach( $result as $hash => $files ) {
+               foreach ( $result as $hash => $files ) {
                        usort( $result[$hash], 'File::compare' );
                }
                return $result;
@@ -335,13 +337,13 @@ class RepoGroup {
         * first parameter.
         *
         * @param $callback Callback: the function to call
-        * @param $params Array: optional additional parameters to pass to the function
+        * @param array $params optional additional parameters to pass to the function
         * @return bool
         */
        function forEachForeignRepo( $callback, $params = array() ) {
-               foreach( $this->foreignRepos as $repo ) {
+               foreach ( $this->foreignRepos as $repo ) {
                        $args = array_merge( array( $repo ), $params );
-                       if( call_user_func_array( $callback, $args ) ) {
+                       if ( call_user_func_array( $callback, $args ) ) {
                                return true;
                        }
                }