Merge "rebuildLocalisationCache: Implement --lang option"
[lhc/web/wiklou.git] / includes / filerepo / file / ForeignAPIFile.php
index 4cc6308..61d321e 100644 (file)
@@ -54,22 +54,22 @@ class ForeignAPIFile extends File {
         */
        static function newFromTitle( Title $title, $repo ) {
                $data = $repo->fetchImageQuery( array(
-                       'titles'            => 'File:' . $title->getDBKey(),
-                       'iiprop'            => self::getProps(),
-                       'prop'              => 'imageinfo',
+                       'titles' => 'File:' . $title->getDBkey(),
+                       'iiprop' => self::getProps(),
+                       'prop' => 'imageinfo',
                        'iimetadataversion' => MediaHandler::getMetadataVersion()
                ) );
 
                $info = $repo->getImageInfo( $data );
 
-               if( $info ) {
+               if ( $info ) {
                        $lastRedirect = isset( $data['query']['redirects'] )
                                ? count( $data['query']['redirects'] ) - 1
                                : -1;
-                       if( $lastRedirect >= 0 ) {
+                       if ( $lastRedirect >= 0 ) {
                                $newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to'] );
                                $img = new self( $newtitle, $repo, $info, true );
-                               if( $img ) {
+                               if ( $img ) {
                                        $img->redirectedFrom( $title->getDBkey() );
                                }
                        } else {
@@ -111,7 +111,7 @@ class ForeignAPIFile extends File {
         * @return bool|MediaTransformOutput
         */
        function transform( $params, $flags = 0 ) {
-               if( !$this->canRender() ) {
+               if ( !$this->canRender() ) {
                        // show icon
                        return parent::transform( $params, $flags );
                }
@@ -161,11 +161,11 @@ class ForeignAPIFile extends File {
         * @return array
         */
        public static function parseMetadata( $metadata ) {
-               if( !is_array( $metadata ) ) {
+               if ( !is_array( $metadata ) ) {
                        return $metadata;
                }
                $ret = array();
-               foreach( $metadata as $meta ) {
+               foreach ( $metadata as $meta ) {
                        $ret[$meta['name']] = self::parseMetadata( $meta['value'] );
                }
                return $ret;
@@ -224,7 +224,7 @@ class ForeignAPIFile extends File {
         * @return string
         */
        function getMimeType() {
-               if( !isset( $this->mInfo['mime'] ) ) {
+               if ( !isset( $this->mInfo['mime'] ) ) {
                        $magic = MimeMagic::singleton();
                        $this->mInfo['mime'] = $magic->guessTypesForExtension( $this->getExtension() );
                }