Merge "Fix use of GenderCache in ApiPageSet::processTitlesArray"
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index ee7ee6f..0d5776b 100644 (file)
@@ -305,7 +305,7 @@ abstract class File implements IDBAccessObject {
         * @return string
         */
        public function getName() {
-               if ( !isset( $this->name ) ) {
+               if ( $this->name === null ) {
                        $this->assertRepoDefined();
                        $this->name = $this->repo->getNameFromTitle( $this->title );
                }
@@ -1172,6 +1172,7 @@ abstract class File implements IDBAccessObject {
                        $thumb = false;
                } elseif ( $thumb->isError() ) { // transform error
                        /** @var MediaTransformError $thumb */
+                       '@phan-var MediaTransformError $thumb';
                        $this->lastError = $thumb->toText();
                        // Ignore errors if requested
                        if ( $wgIgnoreImageErrors && !( $flags & self::RENDER_NOW ) ) {
@@ -1352,7 +1353,8 @@ abstract class File implements IDBAccessObject {
         */
        protected function makeTransformTmpFile( $thumbPath ) {
                $thumbExt = FileBackend::extensionFromPath( $thumbPath );
-               return TempFSFile::factory( 'transform_', $thumbExt, wfTempDir() );
+               return MediaWikiServices::getInstance()->getTempFSFileFactory()
+                       ->newTempFSFile( 'transform_', $thumbExt );
        }
 
        /**
@@ -1520,7 +1522,7 @@ abstract class File implements IDBAccessObject {
         * @return string
         */
        function getHashPath() {
-               if ( !isset( $this->hashPath ) ) {
+               if ( $this->hashPath === null ) {
                        $this->assertRepoDefined();
                        $this->hashPath = $this->repo->getHashPath( $this->getName() );
                }