X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FUnregisteredLocalFile.php;h=fde68bbe74a38bf1b90dd65a3830cb277bbc7097;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hp=b22f8cb34ea1a0b3597e607d640c08fd0554fdd8;hpb=aae0c8d42562d5d3f70cc18fa687ae331996b66f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/UnregisteredLocalFile.php b/includes/filerepo/file/UnregisteredLocalFile.php index b22f8cb34e..4292ea0ace 100644 --- a/includes/filerepo/file/UnregisteredLocalFile.php +++ b/includes/filerepo/file/UnregisteredLocalFile.php @@ -43,7 +43,7 @@ class UnregisteredLocalFile extends File { /** @var bool|string */ protected $mime; - /** @var array Dimension data */ + /** @var array[]|bool[] Dimension data */ protected $dims; /** @var bool|string Handler-specific metadata which will be saved in the img_metadata field */ @@ -55,19 +55,19 @@ class UnregisteredLocalFile extends File { /** * @param string $path Storage path * @param string $mime - * @return UnregisteredLocalFile + * @return static */ static function newFromPath( $path, $mime ) { - return new self( false, false, $path, $mime ); + return new static( false, false, $path, $mime ); } /** * @param Title $title * @param FileRepo $repo - * @return UnregisteredLocalFile + * @return static */ static function newFromTitle( $title, $repo ) { - return new self( $title, $repo, false, false ); + return new static( $title, $repo, false, false ); } /** @@ -108,7 +108,7 @@ class UnregisteredLocalFile extends File { /** * @param int $page - * @return bool + * @return array|bool */ private function cachePageDimensions( $page = 1 ) { $page = (int)$page; @@ -151,7 +151,7 @@ class UnregisteredLocalFile extends File { */ function getMimeType() { if ( !isset( $this->mime ) ) { - $magic = MimeMagic::singleton(); + $magic = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer(); $this->mime = $magic->guessMimeType( $this->getLocalRefPath() ); } @@ -171,8 +171,8 @@ class UnregisteredLocalFile extends File { } /** - * @return int - */ + * @return int + */ function getBitDepth() { $gis = $this->getImageSize( $this->getLocalRefPath() );