Convert all array() syntax to []
[lhc/web/wiklou.git] / includes / filebackend / MemoryFileBackend.php
index 2879ddd..6e32c62 100644 (file)
@@ -33,7 +33,7 @@
  */
 class MemoryFileBackend extends FileBackendStore {
        /** @var array Map of (file path => (data,mtime) */
-       protected $files = array();
+       protected $files = [];
 
        public function getFeatures() {
                return self::ATTR_UNICODE_PATHS;
@@ -53,10 +53,10 @@ class MemoryFileBackend extends FileBackendStore {
                        return $status;
                }
 
-               $this->files[$dst] = array(
+               $this->files[$dst] = [
                        'data' => $params['content'],
                        'mtime' => wfTimestamp( TS_MW, time() )
-               );
+               ];
 
                return $status;
        }
@@ -80,10 +80,10 @@ class MemoryFileBackend extends FileBackendStore {
                        return $status;
                }
 
-               $this->files[$dst] = array(
+               $this->files[$dst] = [
                        'data' => $data,
                        'mtime' => wfTimestamp( TS_MW, time() )
-               );
+               ];
 
                return $status;
        }
@@ -113,10 +113,10 @@ class MemoryFileBackend extends FileBackendStore {
                        return $status;
                }
 
-               $this->files[$dst] = array(
+               $this->files[$dst] = [
                        'data' => $this->files[$src]['data'],
                        'mtime' => wfTimestamp( TS_MW, time() )
-               );
+               ];
 
                return $status;
        }
@@ -151,17 +151,17 @@ class MemoryFileBackend extends FileBackendStore {
                }
 
                if ( isset( $this->files[$src] ) ) {
-                       return array(
+                       return [
                                'mtime' => $this->files[$src]['mtime'],
                                'size' => strlen( $this->files[$src]['data'] ),
-                       );
+                       ];
                }
 
                return false;
        }
 
        protected function doGetLocalCopyMulti( array $params ) {
-               $tmpFiles = array(); // (path => TempFSFile)
+               $tmpFiles = []; // (path => TempFSFile)
                foreach ( $params['srcs'] as $srcPath ) {
                        $src = $this->resolveHashKey( $srcPath );
                        if ( $src === null || !isset( $this->files[$src] ) ) {
@@ -210,7 +210,7 @@ class MemoryFileBackend extends FileBackendStore {
        }
 
        public function getDirectoryListInternal( $container, $dir, array $params ) {
-               $dirs = array();
+               $dirs = [];
                $prefix = rtrim( "$container/$dir", '/' ) . '/';
                $prefixLen = strlen( $prefix );
                foreach ( $this->files as $path => $data ) {
@@ -239,7 +239,7 @@ class MemoryFileBackend extends FileBackendStore {
        }
 
        public function getFileListInternal( $container, $dir, array $params ) {
-               $files = array();
+               $files = [];
                $prefix = rtrim( "$container/$dir", '/' ) . '/';
                $prefixLen = strlen( $prefix );
                foreach ( $this->files as $path => $data ) {