Fix LineLength in includes/media
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sat, 26 Sep 2015 15:53:53 +0000 (18:53 +0300)
committerAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sat, 26 Sep 2015 17:01:29 +0000 (20:01 +0300)
Bug: T102614
Change-Id: Id46d9040e264cd2af1174938dde58ea7d9c0bb5e

includes/media/Bitmap.php
includes/media/ExifBitmap.php
includes/media/MediaHandler.php
includes/media/XMP.php

index 1f00650..0b5b8b6 100644 (file)
@@ -339,7 +339,9 @@ class BitmapHandler extends TransformationalImageHandler {
 
                $src_image = call_user_func( $loader, $params['srcPath'] );
 
-               $rotation = function_exists( 'imagerotate' ) && !isset( $params['disableRotation'] ) ? $this->getRotation( $image ) : 0;
+               $rotation = function_exists( 'imagerotate' ) && !isset( $params['disableRotation'] ) ?
+                       $this->getRotation( $image ) :
+                       0;
                list( $width, $height ) = $this->extractPreRotationDimensions( $params, $rotation );
                $dst_image = imagecreatetruecolor( $width, $height );
 
index 5ba5c68..b2d2443 100644 (file)
@@ -269,9 +269,11 @@ class ExifBitmapHandler extends BitmapHandler {
        }
 
        /**
-        * Swaps an embedded ICC profile for another, if found. Depends on exiftool, no-op if not installed.
+        * Swaps an embedded ICC profile for another, if found.
+        * Depends on exiftool, no-op if not installed.
         * @param string $filepath File to be manipulated (will be overwritten)
-        * @param string $oldProfileString Exact name of color profile to look for (the one that will be replaced)
+        * @param string $oldProfileString Exact name of color profile to look for
+        *  (the one that will be replaced)
         * @param string $profileFilepath ICC profile file to apply to the file
         * @since 1.26
         * @return bool
index 3a59996..9b19921 100644 (file)
@@ -866,14 +866,21 @@ abstract class MediaHandler {
         * Gets configuration for the file warning message. Return value of
         * the following structure:
         *   array(
-        *     'module' => 'example.filewarning.messages', // Required, module with messages loaded for the client
-        *     'messages' => array( // Required, array of names of messages
-        *       'main' => 'example-filewarning-main', // Required, main warning message
-        *       'header' => 'example-filewarning-header', // Optional, header for warning dialog
-        *       'footer' => 'example-filewarning-footer', // Optional, footer for warning dialog
-        *       'info' => 'example-filewarning-info', // Optional, text for more-information link (see below)
+        *     // Required, module with messages loaded for the client
+        *     'module' => 'example.filewarning.messages',
+        *     // Required, array of names of messages
+        *     'messages' => array(
+        *       // Required, main warning message
+        *       'main' => 'example-filewarning-main',
+        *       // Optional, header for warning dialog
+        *       'header' => 'example-filewarning-header',
+        *       // Optional, footer for warning dialog
+        *       'footer' => 'example-filewarning-footer',
+        *       // Optional, text for more-information link (see below)
+        *       'info' => 'example-filewarning-info',
         *     ),
-        *     'link' => 'http://example.com', // Optional, link for more information
+        *     // Optional, link for more information
+        *     'link' => 'http://example.com',
         *   )
         *
         * Returns null if no warning is necessary.
index 64a7e8a..e424b9b 100644 (file)
@@ -429,8 +429,14 @@ class XMPReader implements LoggerAwareInterface {
                }
                $len = unpack( 'Nlength/Noffset', substr( $content, 32, 8 ) );
 
-               if ( !$len || $len['length'] < 4 || $len['offset'] < 0 || $len['offset'] > $len['length'] ) {
-                       $this->logger->info( __METHOD__ . 'Error reading extended XMP block, invalid length or offset.' );
+               if ( !$len ||
+                       $len['length'] < 4 ||
+                       $len['offset'] < 0 ||
+                       $len['offset'] > $len['length']
+               ) {
+                       $this->logger->info(
+                               __METHOD__ . 'Error reading extended XMP block, invalid length or offset.'
+                       );
 
                        return false;
                }
@@ -710,7 +716,6 @@ class XMPReader implements LoggerAwareInterface {
         * @throws RuntimeException
         */
        private function endElementModeLi( $elm ) {
-
                list( $ns, $tag ) = explode( ' ', $this->curItem[0], 2 );
                $info = $this->items[$ns][$tag];
                $finalName = isset( $info['map_name'] )
@@ -734,7 +739,9 @@ class XMPReader implements LoggerAwareInterface {
                                $this->results['xmp-' . $info['map_group']][$finalName]['_type'] = 'lang';
                        }
                } else {
-                       throw new RuntimeException( __METHOD__ . " expected </rdf:seq> or </rdf:bag> but instead got $elm." );
+                       throw new RuntimeException(
+                               __METHOD__ . " expected </rdf:seq> or </rdf:bag> but instead got $elm."
+                       );
                }
        }