Fix some FileRepo IDEA errors
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 4 Dec 2015 23:31:02 +0000 (15:31 -0800)
committerReedy <reedy@wikimedia.org>
Sat, 5 Dec 2015 21:53:16 +0000 (21:53 +0000)
Change-Id: Ia30d82c9ce27503182d95cd9a3f23d80743e7364

includes/filerepo/FileRepo.php

index 647dbec..15007af 100644 (file)
@@ -123,13 +123,13 @@ class FileRepo {
        /** @var bool Whether all zones should be private (e.g. private wiki repo) */
        protected $isPrivate;
 
-       /**
-        * Factory functions for creating new files
-        * Override these in the base class
-        */
+       /** @var array callable Override these in the base class */
        protected $fileFactory = array( 'UnregisteredLocalFile', 'newFromTitle' );
+       /** @var array callable|bool Override these in the base class */
        protected $oldFileFactory = false;
+       /** @var array callable|bool Override these in the base class */
        protected $fileFactoryKey = false;
+       /** @var array callable|bool Override these in the base class */
        protected $oldFileFactoryKey = false;
 
        /**
@@ -1031,8 +1031,10 @@ class FileRepo {
                                $headers = array( 'Content-Disposition' => $triple[2] );
                        } elseif ( is_array( $triple[2] ) && isset( $triple[2]['headers'] ) ) {
                                $headers = $triple[2]['headers'];
+                       } else {
+                               $headers = array();
                        }
-                       // @fixme: $headers might not be defined
+
                        $operations[] = array(
                                'op' => FileBackend::isStoragePath( $src ) ? 'copy' : 'store',
                                'src' => $src,