Fix remaining Generic.Files.LineLength failures
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sat, 3 Oct 2015 13:44:47 +0000 (16:44 +0300)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 3 Oct 2015 17:23:07 +0000 (17:23 +0000)
Except the ones for which there is no clear way to fix
because of T114213.

Bug: T102614
Change-Id: I94a1fc7c890c82a36f0b51e42d311585c275775c

12 files changed:
includes/PHPVersionCheck.php
tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/WikiReferenceTest.php
tests/phpunit/includes/api/format/ApiFormatPhpTest.php
tests/phpunit/includes/api/format/ApiFormatTxtTest.php
tests/phpunit/includes/content/CssContentHandlerTest.php
tests/phpunit/includes/libs/CSSMinTest.php
tests/phpunit/includes/libs/XmlTypeCheckTest.php
tests/phpunit/includes/libs/composer/ComposerLockTest.php
tests/phpunit/includes/logging/ProtectLogFormatterTest.php
tests/phpunit/includes/media/WebPTest.php
tests/phpunit/includes/password/LayeredParameterizedPasswordTest.php

index f7e14a1..233ebf2 100644 (file)
@@ -188,12 +188,14 @@ function wfMissingVendorError( $type, $mwVersion ) {
                . "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
                . "for help on installing the required components.";
 
+       // @codingStandardsIgnoreStart Generic.Files.LineLength
        $longHtml = <<<HTML
                MediaWiki now also has some external dependencies that need to be installed via
                composer or from a separate git repo. Please see
                <a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
                for help on installing the required components.
 HTML;
+       // @codingStandardsIgnoreEnd
 
        wfGenericError( $type, $mwVersion, 'External dependencies', $shortText, $longText, $longHtml );
 }
index b8b5a77..58634d4 100644 (file)
@@ -289,6 +289,7 @@ class LinkerTest extends MediaWikiLangTestCase {
        }
 
        public static function provideCasesForFormatLinksInComment() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array(
                                'foo bar <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>',
@@ -306,5 +307,6 @@ class LinkerTest extends MediaWikiLangTestCase {
                                'enwiki',
                        ),
                );
+               // @codingStandardsIgnoreEnd
        }
 }
index 85ddafc..bcef403 100644 (file)
@@ -85,7 +85,9 @@ class WikiReferenceTest extends PHPUnit_Framework_TestCase {
        /**
         * @dataProvider provideGetCanonicalUrl
         */
-       public function testGetCanonicalUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId ) {
+       public function testGetCanonicalUrl(
+               $expected, $canonicalServer, $server, $path, $page, $fragmentId
+       ) {
                $reference = new WikiReference( $canonicalServer, $path, $server );
                $this->assertEquals( $expected, $reference->getCanonicalUrl( $page, $fragmentId ) );
        }
index 745686f..fd06ad0 100644 (file)
@@ -136,7 +136,8 @@ class ApiFormatPhpTest extends ApiFormatTestBase {
                } catch ( UsageException $ex ) {
                        ob_end_clean();
                        $this->assertSame(
-                               'This response cannot be represented using format=php. See https://phabricator.wikimedia.org/T68776',
+                               'This response cannot be represented using format=php. ' .
+                                       'See https://phabricator.wikimedia.org/T68776',
                                $ex->getMessage(),
                                'Expected exception'
                        );
index 1576c1d..c779a3c 100644 (file)
@@ -9,6 +9,7 @@ class ApiFormatTxtTest extends ApiFormatTestBase {
        protected $printerName = 'txt';
 
        public static function provideGeneralEncoding() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                $warning = "\n    [warnings] => Array\n        (\n            [txt] => Array\n                (\n" .
                        "                    [*] => format=txt has been deprecated. Please use format=json instead.\n" .
                        "                )\n\n        )\n";
@@ -29,7 +30,6 @@ class ApiFormatTxtTest extends ApiFormatTestBase {
                        array( array( 'fóo' ), "Array\n({$warning}\n    [0] => fóo\n)\n" ),
 
                        // Arrays and objects
-                       // @codingStandardsIgnoreStart Generic.Files.LineLength
                        array( array( array() ), "Array\n({$warning}\n    [0] => Array\n        (\n        )\n\n)\n" ),
                        array( array( array( 1 ) ), "Array\n({$warning}\n    [0] => Array\n        (\n            [0] => 1\n        )\n\n)\n" ),
                        array( array( array( 'x' => 1 ) ), "Array\n({$warning}\n    [0] => Array\n        (\n            [x] => 1\n        )\n\n)\n" ),
@@ -50,8 +50,8 @@ class ApiFormatTxtTest extends ApiFormatTestBase {
                        // BC Subelements
                        array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ),
                                "Array\n({$warning}\n    [foo] => Array\n        (\n            [*] => foo\n        )\n\n)\n" ),
-                       // @codingStandardsIgnoreEnd
                );
+               // @codingStandardsIgnoreEnd
        }
 
 }
index e1785a9..58735bc 100644 (file)
@@ -21,10 +21,12 @@ class CssContentHandlerTest extends MediaWikiTestCase {
         * Keep this in sync with CssContentTest::provideGetRedirectTarget()
         */
        public static function provideMakeRedirectContent() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array( 'MediaWiki:MonoBook.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);" ),
                        array( 'User:FooBar/common.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);" ),
                        array( 'Gadget:FooBaz.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ),
                );
+               // @codingStandardsIgnoreEnd
        }
 }
index 7841f30..f4f7bfd 100644 (file)
@@ -188,6 +188,7 @@ class CSSMinTest extends MediaWikiTestCase {
                        . '%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D'
                        . '%228%22%3E%0A%3Ccircle%20cx%3D%224%22%20cy%3D%224%22%20r%3D%222%22%2F%3E%0A%3C%2Fsvg%3E%0A';
 
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array(
                                'Regular file',
@@ -374,6 +375,7 @@ class CSSMinTest extends MediaWikiTestCase {
                                '.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(http://localhost/w/images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }',
                        ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
        /**
index f0ba934..c43d550 100644 (file)
@@ -8,7 +8,9 @@
 class XmlTypeCheckTest extends PHPUnit_Framework_TestCase {
        const WELL_FORMED_XML = "<root><child /></root>";
        const MAL_FORMED_XML = "<root><child /></error>";
+       // @codingStandardsIgnoreStart Generic.Files.LineLength
        const XML_WITH_PIH = '<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/w/index.php"?><svg><child /></svg>';
+       // @codingStandardsIgnoreEnd
 
        /**
         * @covers XMLTypeCheck::newFromString
index cac3b10..6b374f2 100644 (file)
@@ -38,7 +38,8 @@ class ComposerLockTest extends MediaWikiTestCase {
                                                'email' => 'chad@wikimedia.org',
                                        ),
                                ),
-                               'description' => 'Constant Database (CDB) wrapper library for PHP. Provides pure-PHP fallback when dba_* functions are absent.',
+                               'description' => 'Constant Database (CDB) wrapper library for PHP. '.
+                                       'Provides pure-PHP fallback when dba_* functions are absent.',
                        ),
                        'cssjanus/cssjanus' => array(
                                'version' => '1.1.1',
@@ -108,14 +109,18 @@ class ComposerLockTest extends MediaWikiTestCase {
                                                'role' => 'Developer',
                                        ),
                                ),
-                               'description' => 'The only standard solution to translate any kind of text with an avant-garde web interface within MediaWiki, including your documentation and software',
+                               'description' => 'The only standard solution to translate any kind ' .
+                                       'of text with an avant-garde web interface within MediaWiki, ' .
+                                       'including your documentation and software',
                        ),
                        'mediawiki/universal-language-selector' => array(
                                'version' => '2014.12',
                                'type' => 'mediawiki-extension',
                                'licenses' => array( 'GPL-2.0+', 'MIT' ),
                                'authors' => array(),
-                               'description' => 'The primary aim is to allow users to select a language and configure its support in an easy way. Main features are language selection, input methods and web fonts.',
+                               'description' => 'The primary aim is to allow users to select a language ' .
+                                       'and configure its support in an easy way. ' .
+                                       'Main features are language selection, input methods and web fonts.',
                        ),
                ), $lock->getInstalledDependencies(), false, true );
        }
index 558c0fd..17decf3 100644 (file)
@@ -255,7 +255,9 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                        ),
                                ),
                                array(
-                                       'text' => 'User changed protection level for ProtectPage [Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite) [cascading]',
+                                       'text' => 'User changed protection level for ProtectPage ' .
+                                               '[Edit=Allow only administrators] (indefinite) ' .
+                                               '[Move=Allow only administrators] (indefinite) [cascading]',
                                        'api' => array(
                                                'description' => '[edit=sysop] (indefinite)[move=sysop] (indefinite)',
                                                'cascade' => true,
index b6d4114..a92f25a 100644 (file)
@@ -78,10 +78,22 @@ class WebPHandlerTest extends MediaWikiTestCase {
        }
        public function provideTestWithFileExtractMetaData() {
                return array(
-                               array( __DIR__ . '/../../data/media/2_webp_ll.webp',
-                                       array( 'compression' => 'lossless', 'width' => 386, 'height' => 395 ) ),
-                               array( __DIR__ . '/../../data/media/2_webp_a.webp',
-                                       array( 'compression' => 'lossy', 'animated' => false, 'transparency' => true, 'width' => 386, 'height' => 395 ) ),
+                       array( __DIR__ . '/../../data/media/2_webp_ll.webp',
+                               array(
+                                       'compression' => 'lossless',
+                                       'width' => 386,
+                                       'height' => 395
+                               )
+                       ),
+                       array( __DIR__ . '/../../data/media/2_webp_a.webp',
+                               array(
+                                       'compression' => 'lossy',
+                                       'animated' => false,
+                                       'transparency' => true,
+                                       'width' => 386,
+                                       'height' => 395
+                               )
+                       ),
                );
        }
 
index 86e8270..368fda1 100644 (file)
@@ -27,11 +27,11 @@ class LayeredParameterizedPasswordTest extends PasswordTestCase {
        }
 
        public static function providePasswordTests() {
-               /** @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong */
+               // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
                return array(
                        array( true, ':testLargeLayeredTop:sha512:1024:512!sha512:1024:512!sha512:1024:512!sha512:1024:512!5!vnRy+2SrSA0fHt3dwhTP5g==!AVnwfZsAQjn+gULv7FSGjA==!xvHUX3WcpkeSn1lvjWcvBg==!It+OC/N9tu+d3ByHhuB0BQ==!Tb.gqUOiD.aWktVwHM.Q/O!7CcyMfXUPky5ptyATJsR2nq3vUqtnBC', 'testPassword123' ),
                );
-               /** @codingStandardsIgnoreEnd */
+               // @codingStandardsIgnoreEnd
        }
 
        /**