From f63bbdeb08e9de0602f7d046f09430dd132ef263 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 14 Mar 2015 18:52:45 -0700 Subject: [PATCH] Fix phpcs warning and errors in includes/resourceloader Mainly breaking long lines Change-Id: Ide37c81d156348cfb8a010043d79eaf80f95fded --- includes/resourceloader/ResourceLoader.php | 6 ++++-- includes/resourceloader/ResourceLoaderImage.php | 7 ++++++- .../ResourceLoaderImageModule.php | 17 +++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 1922999d1a..1744aa160d 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -854,9 +854,11 @@ class ResourceLoader { $states = array(); if ( !count( $modules ) && !count( $missing ) ) { - return "/* This file is the Web entry point for MediaWiki's ResourceLoader: + return <<. In this request, - no modules were requested. Max made me put this here. */"; + no modules were requested. Max made me put this here. */ +MESSAGE; } $image = $context->getImageObj(); diff --git a/includes/resourceloader/ResourceLoaderImage.php b/includes/resourceloader/ResourceLoaderImage.php index c6e345f52b..4a1f4093c4 100644 --- a/includes/resourceloader/ResourceLoaderImage.php +++ b/includes/resourceloader/ResourceLoaderImage.php @@ -349,7 +349,12 @@ class ResourceLoaderImage { } $handler = new SvgHandler; - $res = $handler->rasterize( $tempFilenameSvg, $tempFilenamePng, $metadata['width'], $metadata['height'] ); + $res = $handler->rasterize( + $tempFilenameSvg, + $tempFilenamePng, + $metadata['width'], + $metadata['height'] + ); unlink( $tempFilenameSvg ); $png = null; diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index 67806fffb7..8fbe4975cb 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -59,11 +59,13 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { * 'prefix' => [CSS class prefix], * // List of variants that may be used for the image files * 'variants' => array( - * // ([image type] is a string, used in generated CSS class names and to match variants to images) + * // ([image type] is a string, used in generated CSS class + * // names and to match variants to images) * [image type] => array( * [variant name] => array( * 'color' => [color string, e.g. '#ffff00'], - * 'global' => [boolean, if true, this variant is available for all images of this type], + * 'global' => [boolean, if true, this variant is available + * for all images of this type], * ), * ) * ), @@ -73,7 +75,8 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { * [file path string], * [file path string] => array( * 'name' => [image name string, defaults to file name], - * 'variants' => [array of variant name strings, variants available for this image], + * 'variants' => [array of variant name strings, variants + * available for this image], * ), * ) * ), @@ -167,7 +170,13 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { $variantConfig = array(); } - $image = new ResourceLoaderImage( $name, $this->getName(), $imageDesc, $this->localBasePath, $variantConfig ); + $image = new ResourceLoaderImage( + $name, + $this->getName(), + $imageDesc, + $this->localBasePath, + $variantConfig + ); $this->imageObjects[ $image->getName() ] = $image; } } -- 2.20.1