Break some long lines in maintenance, skins, tests
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 24 Jul 2014 17:03:17 +0000 (19:03 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 24 Jul 2014 17:03:17 +0000 (19:03 +0200)
Change-Id: I5d86ad3e0c90e09440268a670f5af3e2bf080612

12 files changed:
maintenance/deleteEqualMessages.php
maintenance/generateJsonI18n.php
maintenance/install.php
skins/Vector/VectorTemplate.php
tests/parserTests.php
tests/phpunit/includes/MessageTest.php
tests/phpunit/includes/MimeMagicTest.php
tests/phpunit/includes/filerepo/RepoGroupTest.php
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/includes/poolcounter/PoolCounterTest.php
tests/testHelpers.inc
thumb.php

index a07cbc2..3d30b83 100644 (file)
@@ -30,11 +30,13 @@ require_once __DIR__ . '/Maintenance.php';
 class DeleteEqualMessages extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Deletes all pages in the MediaWiki namespace that are equal to the default message";
+               $this->mDescription = "Deletes all pages in the MediaWiki namespace that are equal to '
+                       . 'the default message";
                $this->addOption( 'delete', 'Actually delete the pages (default: dry run)' );
                $this->addOption( 'delete-talk', 'Don\'t leave orphaned talk pages behind during deletion' );
-               $this->addOption( 'lang-code', 'Check for subpages of this language code (default: root page against content language). ' .
-                       'Use value "*" to run for all mwfile language code subpages (including the base pages that override content language).', false, true );
+               $this->addOption( 'lang-code', 'Check for subpages of this language code (default: root '
+                       . 'page against content language). Use value "*" to run for all mwfile language code '
+                       . 'subpages (including the base pages that override content language).', false, true );
        }
 
        /**
@@ -59,7 +61,8 @@ class DeleteEqualMessages extends Maintenance {
                // Normalise message names for NS_MEDIAWIKI page_title
                $messageNames = array_map( array( $wgContLang, 'ucfirst' ), $messageNames );
 
-               $statuses = AllMessagesTablePager::getCustomisedStatuses( $messageNames, $langCode, $nonContLang );
+               $statuses = AllMessagesTablePager::getCustomisedStatuses(
+                       $messageNames, $langCode, $nonContLang );
                // getCustomisedStatuses is stripping the sub page from the page titles, add it back
                $titleSuffix = $nonContLang ? "/$langCode" : '';
 
@@ -134,8 +137,10 @@ class DeleteEqualMessages extends Maintenance {
                        return;
                }
 
-               $this->output( "\n{$messageInfo['relevantPages']} pages in the MediaWiki namespace override messages." );
-               $this->output( "\n{$messageInfo['equalPages']} pages are equal to the default message (+ {$messageInfo['equalPagesTalks']} talk pages).\n" );
+               $this->output( "\n{$messageInfo['relevantPages']} pages in the MediaWiki namespace ' .
+                       'override messages." );
+               $this->output( "\n{$messageInfo['equalPages']} pages are equal to the default message ' .
+                       '(+ {$messageInfo['equalPagesTalks']} talk pages).\n" );
 
                if ( !$doDelete ) {
                        $list = '';
@@ -182,7 +187,8 @@ class DeleteEqualMessages extends Maintenance {
                                $this->output( "\n* [[$title]]" );
                                $page = WikiPage::factory( $title );
                                $error = ''; // Passed by ref
-                               $page->doDeleteArticle( 'Orphaned talk page of no longer required message', false, 0, false, $error, $user );
+                               $page->doDeleteArticle( 'Orphaned talk page of no longer required message',
+                                       false, 0, false, $error, $user );
                        }
                }
                $this->output( "\n\ndone!\n" );
index 83e731a..22d9940 100644 (file)
@@ -80,7 +80,8 @@ class GenerateJsonI18n extends Maintenance {
                        }
                        $this->output( "Searching for supplementary i18n files...\n" );
                        $dir_iterator = new RecursiveDirectoryIterator( dirname( $phpfile ) );
-                       $iterator = new RecursiveIteratorIterator( $dir_iterator, RecursiveIteratorIterator::LEAVES_ONLY );
+                       $iterator = new RecursiveIteratorIterator(
+                               $dir_iterator, RecursiveIteratorIterator::LEAVES_ONLY );
                        foreach ( $iterator as $path => $fileObject ) {
                                if ( fnmatch( "*.i18n.php", $fileObject->getFilename() ) ) {
                                        $this->output( "Converting $path.\n" );
index 3b29452..9a73f2e 100644 (file)
@@ -34,7 +34,8 @@ require_once dirname( __DIR__ ) . '/maintenance/Maintenance.php';
 /**
  * Maintenance script to install and configure MediaWiki
  *
- * Default values for the options are defined in DefaultSettings.php (see the mapping in CliInstaller.php)
+ * Default values for the options are defined in DefaultSettings.php
+ * (see the mapping in CliInstaller.php)
  * Default for --dbpath (SQLite-specific) is defined in SqliteInstaller::getGlobalDefaults
  *
  * @ingroup Maintenance
@@ -85,9 +86,11 @@ class CommandLineInstaller extends Maintenance {
                        true
                );
                $this->addOption( 'confpath', "Path to write LocalSettings.php to ($IP)", false, true );
-               $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in PostgreSQL/Microsoft SQL Server (mediawiki)', false, true );
+               $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in '
+                       . 'PostgreSQL/Microsoft SQL Server (mediawiki)', false, true );
                /*
-               $this->addOption( 'namespace', 'The project namespace (same as the "name" argument)', false, true );
+               $this->addOption( 'namespace', 'The project namespace (same as the "name" argument)',
+                       false, true );
                */
                $this->addOption( 'env-checks', "Run environment checks only, don't change anything" );
        }
index 0ec031f..291b761 100644 (file)
@@ -492,7 +492,9 @@ class VectorTemplate extends BaseTemplate {
                                                echo ' emptyPortlet';
                                        }
                                        ?>" aria-labelledby="p-cactions-label">
-                                               <h3 id="p-cactions-label"><span><?php $this->msg( 'vector-more-actions' ) ?></span><a href="#"></a></h3>
+                                               <h3 id="p-cactions-label"><span><?php
+                                                       $this->msg( 'vector-more-actions' )
+                                               ?></span><a href="#"></a></h3>
 
                                                <div class="menu">
                                                        <ul<?php $this->html( 'userlangattributes' ) ?>>
index d7e8b86..9965c43 100644 (file)
@@ -24,7 +24,8 @@
  * @ingroup Testing
  */
 
-$otions = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled', 'run-parsoid' );
+$otions = array( 'quick', 'color', 'quiet', 'help', 'show-output',
+       'record', 'run-disabled', 'run-parsoid' );
 $optionsWithArgs = array( 'regex', 'filter', 'seed', 'setversion' );
 
 require_once __DIR__ . '/../maintenance/commandLine.inc';
index 7db985b..6a36b4b 100644 (file)
@@ -119,7 +119,8 @@ class MessageTest extends MediaWikiLangTestCase {
         */
        public function testInLanguage() {
                $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() );
-               $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
+               $this->assertEquals( 'Заглавная страница',
+                       wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
 
                // NOTE: make sure internal caching of the message text is reset appropriately
                $msg = wfMessage( 'mainpage' );
index a164ff9..2937790 100644 (file)
@@ -30,7 +30,8 @@ class MimeMagicTest extends MediaWikiTestCase {
                        array( 'tsv', 'text/plain', 'text/tab-separated-values' ),
                        array( 'json', 'text/plain', 'application/json' ),
                        array( 'foo', 'application/x-opc+zip', 'application/zip' ),
-                       array( 'docx', 'application/x-opc+zip', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ),
+                       array( 'docx', 'application/x-opc+zip',
+                               'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ),
                        array( 'djvu', 'image/x-djvu', 'image/vnd.djvu' ),
                        array( 'wav', 'audio/wav', 'audio/wav' ),
                );
index f9b4ad5..5bdb7e7 100644 (file)
@@ -17,7 +17,8 @@ class RepoGroupTest extends MediaWikiTestCase {
                $this->setUpForeignRepo();
                $fakeCallback = $this->getMock( 'RepoGroupTestHelper' );
                $fakeCallback->expects( $this->once() )->method( 'callback' );
-               RepoGroup::singleton()->forEachForeignRepo( array( $fakeCallback, 'callback' ), array( array() ) );
+               RepoGroup::singleton()->forEachForeignRepo(
+                       array( $fakeCallback, 'callback' ), array( array() ) );
        }
 
        function testForEachForeignRepoNone() {
@@ -26,7 +27,8 @@ class RepoGroupTest extends MediaWikiTestCase {
                FileBackendGroup::destroySingleton();
                $fakeCallback = $this->getMock( 'RepoGroupTestHelper' );
                $fakeCallback->expects( $this->never() )->method( 'callback' );
-               RepoGroup::singleton()->forEachForeignRepo( array( $fakeCallback, 'callback' ), array( array() ) );
+               RepoGroup::singleton()->forEachForeignRepo(
+                       array( $fakeCallback, 'callback' ), array( array() ) );
        }
 
        private function setUpForeignRepo() {
index 253c10b..1dcc4cd 100644 (file)
@@ -495,19 +495,23 @@ class NewParserTest extends MediaWikiTestCase {
                $backend = RepoGroup::singleton()->getLocalRepo()->getBackend();
                $backend->prepare( array( 'dir' => "$base/local-public/3/3a" ) );
                $backend->store( array(
-                       'src' => "$IP/tests/phpunit/data/parser/headbg.jpg", 'dst' => "$base/local-public/3/3a/Foobar.jpg"
+                       'src' => "$IP/tests/phpunit/data/parser/headbg.jpg",
+                       'dst' => "$base/local-public/3/3a/Foobar.jpg"
                ) );
                $backend->prepare( array( 'dir' => "$base/local-public/e/ea" ) );
                $backend->store( array(
-                       'src' => "$IP/tests/phpunit/data/parser/wiki.png", 'dst' => "$base/local-public/e/ea/Thumb.png"
+                       'src' => "$IP/tests/phpunit/data/parser/wiki.png",
+                       'dst' => "$base/local-public/e/ea/Thumb.png"
                ) );
                $backend->prepare( array( 'dir' => "$base/local-public/0/09" ) );
                $backend->store( array(
-                       'src' => "$IP/tests/phpunit/data/parser/headbg.jpg", 'dst' => "$base/local-public/0/09/Bad.jpg"
+                       'src' => "$IP/tests/phpunit/data/parser/headbg.jpg",
+                       'dst' => "$base/local-public/0/09/Bad.jpg"
                ) );
                $backend->prepare( array( 'dir' => "$base/local-public/5/5f" ) );
                $backend->store( array(
-                       'src' => "$IP/tests/phpunit/data/parser/LoremIpsum.djvu", 'dst' => "$base/local-public/5/5f/LoremIpsum.djvu"
+                       'src' => "$IP/tests/phpunit/data/parser/LoremIpsum.djvu",
+                       'dst' => "$base/local-public/5/5f/LoremIpsum.djvu"
                ) );
 
                // No helpful SVG file to copy, so make one ourselves
index d9cd57e..019e532 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 
-// We will use this class with getMockForAbstractClass to create a concrete mock class. That call will die if the
-// contructor is not public, unless we use disableOriginalConstructor(), in which case we could not test the constructor.
+// We will use this class with getMockForAbstractClass to create a concrete mock class.
+// That call will die if the contructor is not public, unless we use disableOriginalConstructor(),
+// in which case we could not test the constructor.
 abstract class PoolCounterAbstractMock extends PoolCounter {
        public function __construct() {
                call_user_func_array( 'parent::__construct', func_get_args() );
@@ -19,8 +20,8 @@ class PoolCounterTest extends MediaWikiTestCase {
 
                $poolCounter = $this->getMockBuilder( 'PoolCounterAbstractMock' )
                        ->setConstructorArgs( array( $poolCounterConfig, 'testCounter', 'someKey' ) )
-                       // don't mock anything - the proper syntax would be setMethods(null), but due to a PHPUnit bug that
-                       // does not work with getMockForAbstractClass()
+                       // don't mock anything - the proper syntax would be setMethods(null), but due
+                       // to a PHPUnit bug that does not work with getMockForAbstractClass()
                        ->setMethods( array( 'idontexist' ) )
                        ->getMockForAbstractClass();
                $this->assertInstanceOf( 'PoolCounter', $poolCounter );
@@ -44,8 +45,8 @@ class PoolCounterTest extends MediaWikiTestCase {
 
        public function testHashKeyIntoSlots() {
                $poolCounter = $this->getMockBuilder( 'PoolCounterAbstractMock' )
-                       // don't mock anything - the proper syntax would be setMethods(null), but due to a PHPUnit bug that
-                       // does not work with getMockForAbstractClass()
+                       // don't mock anything - the proper syntax would be setMethods(null), but due
+                       // to a PHPUnit bug that does not work with getMockForAbstractClass()
                        ->setMethods( array( 'idontexist' ) )
                        ->disableOriginalConstructor()
                        ->getMockForAbstractClass();
index d7342af..717c5f3 100644 (file)
@@ -352,7 +352,11 @@ class DbTestRecorder extends DbTestPreviewer {
 class TestFileIterator implements Iterator {
        private $file;
        private $fh;
-       private $parserTest; /* An instance of ParserTest (parserTests.php) or MediaWikiParserTest (phpunit) */
+       /**
+        * @var ParserTest|MediaWikiParserTest An instance of ParserTest (parserTests.php)
+        *  or MediaWikiParserTest (phpunit)
+        */
+       private $parserTest;
        private $index = 0;
        private $test;
        private $section = null;
@@ -426,7 +430,9 @@ class TestFileIterator implements Iterator {
                                        $this->checkSection( 'text' );
                                        $this->checkSection( 'article' );
 
-                                       $this->parserTest->addArticle( ParserTest::chomp( $this->sectionData['article'] ), $this->sectionData['text'], $this->lineNum );
+                                       $this->parserTest->addArticle(
+                                               ParserTest::chomp( $this->sectionData['article'] ),
+                                               $this->sectionData['text'], $this->lineNum );
 
                                        $this->clearSection();
 
@@ -497,8 +503,10 @@ class TestFileIterator implements Iterator {
                                        }
 
                                        if ( $input == false || $result == false ||
-                                               ( ( preg_match( '/\\bdisabled\\b/i', $this->sectionData['options'] ) && !$this->parserTest->runDisabled )
-                                               || ( preg_match( '/\\bparsoid\\b/i', $this->sectionData['options'] ) && $result != 'html/php' && !$this->parserTest->runParsoid )
+                                               ( ( preg_match( '/\\bdisabled\\b/i', $this->sectionData['options'] )
+                                                       && !$this->parserTest->runDisabled )
+                                               || ( preg_match( '/\\bparsoid\\b/i', $this->sectionData['options'] )
+                                                       && $result != 'html/php' && !$this->parserTest->runParsoid )
                                                || !preg_match( "/" . $this->parserTest->regex . "/i", $this->sectionData['test'] ) )
                                        ) {
                                                # disabled test
@@ -530,7 +538,8 @@ class TestFileIterator implements Iterator {
                                }
 
                                if ( isset( $this->sectionData[$this->section] ) ) {
-                                       throw new MWException( "duplicate section '$this->section' at line {$this->lineNum} of $this->file\n" );
+                                       throw new MWException( "duplicate section '$this->section' "
+                                               . "at line {$this->lineNum} of $this->file\n" );
                                }
 
                                $this->sectionData[$this->section] = '';
@@ -640,7 +649,8 @@ class DelayedParserTest {
         */
        public function unleash( &$parserTest ) {
                if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest )     ) {
-                       throw new MWException( __METHOD__ . " must be passed an instance of ParserTest or NewParserTest classes\n" );
+                       throw new MWException( __METHOD__ . " must be passed an instance of ParserTest or "
+                               . "NewParserTest classes\n" );
                }
 
                # Trigger delayed hooks. Any failure will make us abort
index 9a4b332..fe50e2e 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -388,7 +388,8 @@ function wfGenerateThumbnail( File $file, array $params, $thumbName, $thumbPath
        $errorHtml = false;
 
        // guard thumbnail rendering with PoolCounter to avoid stampedes
-       // expensive files use a separate PoolCounter config so it is possible to set up a global limit on them
+       // expensive files use a separate PoolCounter config so it is possible
+       // to set up a global limit on them
        if ( $file->isExpensiveToThumbnail() ) {
                $poolCounterType = 'FileRenderExpensive';
        } else {