Merge "Add SpecialBlockModifyFormFields hook"
[lhc/web/wiklou.git] / includes / filerepo / file / ForeignAPIFile.php
old mode 100755 (executable)
new mode 100644 (file)
index 0b3d5df..690d1b8
@@ -34,7 +34,7 @@ class ForeignAPIFile extends File {
 
        /**
         * @param $title
-        * @param $repo ForeignApiRepo
+        * @param ForeignApiRepo $repo
         * @param $info
         * @param bool $exists
         */
@@ -48,8 +48,8 @@ class ForeignAPIFile extends File {
        }
 
        /**
-        * @param $title Title
-        * @param $repo ForeignApiRepo
+        * @param Title $title
+        * @param ForeignApiRepo $repo
         * @return ForeignAPIFile|null
         */
        static function newFromTitle( Title $title, $repo ) {
@@ -78,6 +78,7 @@ class ForeignAPIFile extends File {
                        } else {
                                $img = new self( $title, $repo, $info, true );
                        }
+
                        return $img;
                } else {
                        return null;
@@ -133,6 +134,7 @@ class ForeignAPIFile extends File {
                );
                if ( $thumbUrl === false ) {
                        global $wgLang;
+
                        return $this->repo->getThumbError(
                                $this->getName(),
                                $width,
@@ -141,13 +143,14 @@ class ForeignAPIFile extends File {
                                $wgLang->getCode()
                        );
                }
+
                return $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params );
        }
 
        // Info we can get from API...
 
        /**
-        * @param $page int
+        * @param int $page
         * @return int|number
         */
        public function getWidth( $page = 1 ) {
@@ -155,7 +158,7 @@ class ForeignAPIFile extends File {
        }
 
        /**
-        * @param $page int
+        * @param int $page
         * @return int
         */
        public function getHeight( $page = 1 ) {
@@ -169,21 +172,24 @@ class ForeignAPIFile extends File {
                if ( isset( $this->mInfo['metadata'] ) ) {
                        return serialize( self::parseMetadata( $this->mInfo['metadata'] ) );
                }
+
                return null;
        }
 
        /**
-        * @return array|null extended metadata (see imageinfo API for format) or null on error
+        * @return array|null Extended metadata (see imageinfo API for format) or
+        *   null on error
         */
        public function getExtendedMetadata() {
                if ( isset( $this->mInfo['extmetadata'] ) ) {
                        return $this->mInfo['extmetadata'];
                }
+
                return null;
        }
 
        /**
-        * @param $metadata array
+        * @param array $metadata
         * @return array
         */
        public static function parseMetadata( $metadata ) {
@@ -194,6 +200,7 @@ class ForeignAPIFile extends File {
                foreach ( $metadata as $meta ) {
                        $ret[$meta['name']] = self::parseMetadata( $meta['value'] );
                }
+
                return $ret;
        }
 
@@ -220,6 +227,8 @@ class ForeignAPIFile extends File {
        }
 
        /**
+        * @param int $audience
+        * @param User $user
         * @return null|string
         */
        public function getDescription( $audience = self::FOR_PUBLIC, User $user = null ) {
@@ -236,7 +245,7 @@ class ForeignAPIFile extends File {
        }
 
        /**
-        * @return bool|Mixed|string
+        * @return bool|string
         */
        function getTimestamp() {
                return wfTimestamp( TS_MW,
@@ -254,6 +263,7 @@ class ForeignAPIFile extends File {
                        $magic = MimeMagic::singleton();
                        $this->mInfo['mime'] = $magic->guessTypesForExtension( $this->getExtension() );
                }
+
                return $this->mInfo['mime'];
        }
 
@@ -265,6 +275,7 @@ class ForeignAPIFile extends File {
                        return $this->mInfo['mediatype'];
                }
                $magic = MimeMagic::singleton();
+
                return $magic->getMediaType( null, $this->getMimeType() );
        }
 
@@ -279,7 +290,7 @@ class ForeignAPIFile extends File {
 
        /**
         * Only useful if we're locally caching thumbs anyway...
-        * @param $suffix string
+        * @param string $suffix
         * @return null|string
         */
        function getThumbPath( $suffix = '' ) {
@@ -288,6 +299,7 @@ class ForeignAPIFile extends File {
                        if ( $suffix ) {
                                $path = $path . $suffix . '/';
                        }
+
                        return $path;
                } else {
                        return null;
@@ -327,7 +339,7 @@ class ForeignAPIFile extends File {
        }
 
        /**
-        * @param $options array
+        * @param array $options
         */
        function purgeThumbnails( $options = array() ) {
                global $wgMemc;