Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/149044
Change subject: Break some long lines in maintenance, skins, tests ...................................................................... Break some long lines in maintenance, skins, tests Change-Id: I5d86ad3e0c90e09440268a670f5af3e2bf080612 --- M maintenance/deleteEqualMessages.php M maintenance/generateJsonI18n.php M maintenance/install.php M skins/Vector/VectorTemplate.php M tests/parserTests.php M tests/phpunit/includes/MessageTest.php M tests/phpunit/includes/MimeMagicTest.php M tests/phpunit/includes/filerepo/RepoGroupTest.php M tests/phpunit/includes/parser/NewParserTest.php M tests/phpunit/includes/poolcounter/PoolCounterTest.php M tests/testHelpers.inc M thumb.php 12 files changed, 67 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/44/149044/1 diff --git a/maintenance/deleteEqualMessages.php b/maintenance/deleteEqualMessages.php index a07cbc2..3d30b83 100644 --- a/maintenance/deleteEqualMessages.php +++ b/maintenance/deleteEqualMessages.php @@ -30,11 +30,13 @@ 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 @@ // 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 @@ 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 @@ $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" ); diff --git a/maintenance/generateJsonI18n.php b/maintenance/generateJsonI18n.php index 83e731a..22d9940 100644 --- a/maintenance/generateJsonI18n.php +++ b/maintenance/generateJsonI18n.php @@ -80,7 +80,8 @@ } $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" ); diff --git a/maintenance/install.php b/maintenance/install.php index 3b29452..9a73f2e 100644 --- a/maintenance/install.php +++ b/maintenance/install.php @@ -34,7 +34,8 @@ /** * 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 @@ 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" ); } diff --git a/skins/Vector/VectorTemplate.php b/skins/Vector/VectorTemplate.php index 0ec031f..291b761 100644 --- a/skins/Vector/VectorTemplate.php +++ b/skins/Vector/VectorTemplate.php @@ -492,7 +492,9 @@ 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' ) ?>> diff --git a/tests/parserTests.php b/tests/parserTests.php index d7e8b86..9965c43 100644 --- a/tests/parserTests.php +++ b/tests/parserTests.php @@ -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'; diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 7db985b..6a36b4b 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -119,7 +119,8 @@ */ 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' ); diff --git a/tests/phpunit/includes/MimeMagicTest.php b/tests/phpunit/includes/MimeMagicTest.php index a164ff9..2937790 100644 --- a/tests/phpunit/includes/MimeMagicTest.php +++ b/tests/phpunit/includes/MimeMagicTest.php @@ -30,7 +30,8 @@ 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' ), ); diff --git a/tests/phpunit/includes/filerepo/RepoGroupTest.php b/tests/phpunit/includes/filerepo/RepoGroupTest.php index f9b4ad5..5bdb7e7 100644 --- a/tests/phpunit/includes/filerepo/RepoGroupTest.php +++ b/tests/phpunit/includes/filerepo/RepoGroupTest.php @@ -17,7 +17,8 @@ $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 @@ 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() { diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 253c10b..1dcc4cd 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -495,19 +495,23 @@ $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 diff --git a/tests/phpunit/includes/poolcounter/PoolCounterTest.php b/tests/phpunit/includes/poolcounter/PoolCounterTest.php index d9cd57e..019e532 100644 --- a/tests/phpunit/includes/poolcounter/PoolCounterTest.php +++ b/tests/phpunit/includes/poolcounter/PoolCounterTest.php @@ -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 @@ $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 @@ 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(); diff --git a/tests/testHelpers.inc b/tests/testHelpers.inc index d7342af..717c5f3 100644 --- a/tests/testHelpers.inc +++ b/tests/testHelpers.inc @@ -352,7 +352,11 @@ 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 @@ $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 @@ } 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 @@ } 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 @@ */ 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 diff --git a/thumb.php b/thumb.php index 9a4b332..fe50e2e 100644 --- a/thumb.php +++ b/thumb.php @@ -388,7 +388,8 @@ $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 { -- To view, visit https://gerrit.wikimedia.org/r/149044 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d86ad3e0c90e09440268a670f5af3e2bf080612 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits