From 7a2d08ee72e51fd76c2243ff64cc11d33323a50e Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sat, 26 Sep 2015 18:53:53 +0300 Subject: [PATCH] Fix LineLength in includes/media Bug: T102614 Change-Id: Id46d9040e264cd2af1174938dde58ea7d9c0bb5e --- includes/media/Bitmap.php | 4 +++- includes/media/ExifBitmap.php | 6 ++++-- includes/media/MediaHandler.php | 21 ++++++++++++++------- includes/media/XMP.php | 15 +++++++++++---- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 1f00650445..0b5b8b6205 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -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 ); diff --git a/includes/media/ExifBitmap.php b/includes/media/ExifBitmap.php index 5ba5c68c00..b2d24435a2 100644 --- a/includes/media/ExifBitmap.php +++ b/includes/media/ExifBitmap.php @@ -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 diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index 3a59996c58..9b199212d1 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -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. diff --git a/includes/media/XMP.php b/includes/media/XMP.php index 64a7e8a805..e424b9b981 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -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 or but instead got $elm." ); + throw new RuntimeException( + __METHOD__ . " expected or but instead got $elm." + ); } } -- 2.20.1