Split LocalFile.php to have one class in one file
[lhc/web/wiklou.git] / includes / filerepo / file / ForeignAPIFile.php
index 8e0242d..ab8ef2f 100644 (file)
@@ -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;
        }
 
        /**