X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FForeignAPIFile.php;h=ab8ef2f8de91ed8888fe3ff72ce8ab36ae7cf414;hb=b8ec4a8ff8fe917fd69ecfa6d2a07e031848e197;hp=8e0242d3cf84f11b53127054a4c6f273126e5a8c;hpb=9c5d5606fcdc20ba9264d006e9f2f9533bb8dc3f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/ForeignAPIFile.php b/includes/filerepo/file/ForeignAPIFile.php index 8e0242d3cf..ab8ef2f8de 100644 --- a/includes/filerepo/file/ForeignAPIFile.php +++ b/includes/filerepo/file/ForeignAPIFile.php @@ -154,7 +154,7 @@ class ForeignAPIFile extends File { /** * @param int $page - * @return int|number + * @return int */ public function getWidth( $page = 1 ) { return isset( $this->mInfo['width'] ) ? intval( $this->mInfo['width'] ) : 0; @@ -184,11 +184,7 @@ class ForeignAPIFile extends File { * null on error */ public function getExtendedMetadata() { - if ( isset( $this->mInfo['extmetadata'] ) ) { - return $this->mInfo['extmetadata']; - } - - return null; + return $this->mInfo['extmetadata'] ?? null; } /** @@ -318,16 +314,15 @@ class ForeignAPIFile extends File { * @return null|string */ function getThumbPath( $suffix = '' ) { - if ( $this->repo->canCacheThumbs() ) { - $path = $this->repo->getZonePath( 'thumb' ) . '/' . $this->getHashPath(); - if ( $suffix ) { - $path .= $suffix . '/'; - } - - return $path; - } else { + if ( !$this->repo->canCacheThumbs() ) { return null; } + + $path = $this->repo->getZonePath( 'thumb' ) . '/' . $this->getHashPath(); + if ( $suffix ) { + $path .= $suffix . '/'; + } + return $path; } /**