Convert all array() syntax to []
[lhc/web/wiklou.git] / includes / filerepo / RepoGroup.php
index c89dca1..08a40eb 100644 (file)
@@ -117,10 +117,10 @@ class RepoGroup {
         *   latest:         If true, load from the latest available data into File objects
         * @return File|bool False if title is not found
         */
-       function findFile( $title, $options = array() ) {
+       function findFile( $title, $options = [] ) {
                if ( !is_array( $options ) ) {
                        // MW 1.15 compat
-                       $options = array( 'time' => $options );
+                       $options = [ 'time' => $options ];
                }
                if ( isset( $options['bypassCache'] ) ) {
                        $options['latest'] = $options['bypassCache']; // b/c
@@ -193,10 +193,10 @@ class RepoGroup {
                        $this->initialiseRepos();
                }
 
-               $items = array();
+               $items = [];
                foreach ( $inputItems as $item ) {
                        if ( !is_array( $item ) ) {
-                               $item = array( 'title' => $item );
+                               $item = [ 'title' => $item ];
                        }
                        $item['title'] = File::normalizeTitle( $item['title'] );
                        if ( $item['title'] ) {
@@ -251,7 +251,7 @@ class RepoGroup {
         * @param array $options Option array, same as findFile()
         * @return File|bool File object or false if it is not found
         */
-       function findFileFromKey( $hash, $options = array() ) {
+       function findFileFromKey( $hash, $options = [] ) {
                if ( !$this->reposInitialised ) {
                        $this->initialiseRepos();
                }
@@ -366,12 +366,12 @@ class RepoGroup {
         * @param array $params Optional additional parameters to pass to the function
         * @return bool
         */
-       function forEachForeignRepo( $callback, $params = array() ) {
+       function forEachForeignRepo( $callback, $params = [] ) {
                if ( !$this->reposInitialised ) {
                        $this->initialiseRepos();
                }
                foreach ( $this->foreignRepos as $repo ) {
-                       $args = array_merge( array( $repo ), $params );
+                       $args = array_merge( [ $repo ], $params );
                        if ( call_user_func_array( $callback, $args ) ) {
                                return true;
                        }
@@ -401,7 +401,7 @@ class RepoGroup {
                $this->reposInitialised = true;
 
                $this->localRepo = $this->newRepo( $this->localInfo );
-               $this->foreignRepos = array();
+               $this->foreignRepos = [];
                foreach ( $this->foreignInfo as $key => $info ) {
                        $this->foreignRepos[$key] = $this->newRepo( $info );
                }