From ce08326cda0c8c6a8d53d8f6f2c91fdc936a14c2 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 11 Oct 2014 21:11:57 +0200 Subject: [PATCH] Break long lines Change-Id: I8d4e883058c21023273df88439cd145888833115 --- includes/EditPage.php | 11 +++++--- includes/OutputPage.php | 4 ++- includes/page/Article.php | 26 ++++++++++++------- .../specials/SpecialDeletedContributions.php | 3 ++- includes/specials/SpecialEditWatchlist.php | 5 +++- includes/specials/SpecialListfiles.php | 4 ++- includes/specials/SpecialUndelete.php | 4 ++- includes/specials/SpecialWatchlist.php | 12 ++++++--- .../phpunit/includes/TitlePermissionTest.php | 6 +++-- .../includes/cache/RedisBloomCacheTest.php | 3 ++- 10 files changed, 55 insertions(+), 23 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index a423f260c7..ca28c07248 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -779,7 +779,8 @@ class EditPage { // TODO: softened the check for cutover. Once we determine // that it is safe, we should complete the transition by // removing the "edittime" clause. - $this->incompleteForm = ( !$request->getVal( 'wpUltimateParam' ) && is_null( $this->edittime ) ); + $this->incompleteForm = ( !$request->getVal( 'wpUltimateParam' ) + && is_null( $this->edittime ) ); } if ( $this->incompleteForm ) { # If the form is incomplete, force to preview. @@ -2137,7 +2138,8 @@ class EditPage { if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'userpage-userdoesnotexist', wfEscapeWikiText( $username ) ) ); - } elseif ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) { # Show log extract if the user is currently blocked + } elseif ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) { + # Show log extract if the user is currently blocked LogEventsList::showLogExtract( $wgOut, 'block', @@ -2204,7 +2206,10 @@ class EditPage { if ( $title instanceof Title && $title->exists() && $title->userCan( 'read' ) ) { global $wgOut; // Added using template syntax, to take 's into account. - $wgOut->addWikiTextTitleTidy( '
{{:' . $title->getFullText() . '}}
', $this->mTitle ); + $wgOut->addWikiTextTitleTidy( + '
{{:' . $title->getFullText() . '}}
', + $this->mTitle + ); return true; } } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 5176c2b4b2..084f714601 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3512,7 +3512,9 @@ class OutputPage extends ContextSource { $moduleStyles[] = 'user.groups'; // Per-user custom styles - if ( $this->getConfig()->get( 'AllowUserCss' ) && $this->getTitle()->isCssSubpage() && $this->userCanPreview() ) { + if ( $this->getConfig()->get( 'AllowUserCss' ) && $this->getTitle()->isCssSubpage() + && $this->userCanPreview() + ) { // We're on a preview of a CSS subpage // Exclude this page from the user module in case it's in there (bug 26283) $link = $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES, false, diff --git a/includes/page/Article.php b/includes/page/Article.php index 96e315fab2..54fab29a55 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1218,7 +1218,8 @@ class Article implements Page { if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist $outputPage->wrapWikiMsg( "
\n\$1\n
", array( 'userpage-userdoesnotexist-view', wfEscapeWikiText( $rootPart ) ) ); - } elseif ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) { # Show log extract if the user is currently blocked + } elseif ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) { + # Show log extract if the user is currently blocked LogEventsList::showLogExtract( $outputPage, 'block', @@ -1381,9 +1382,14 @@ class Article implements Page { : 'revision-info'; $outputPage = $this->getContext()->getOutput(); - $outputPage->addSubtitle( "
" . wfMessage( $infomsg, - $td )->rawParams( $userlinks )->params( $revision->getID(), $tddate, - $tdtime, $revision->getUserText() )->rawParams( Linker::revComment( $revision, true, true ) )->parse() . "
" ); + $outputPage->addSubtitle( "
" . + wfMessage( $infomsg, $td ) + ->rawParams( $userlinks ) + ->params( $revision->getID(), $tddate, $tdtime, $revision->getUserText() ) + ->rawParams( Linker::revComment( $revision, true, true ) ) + ->parse() . + "
" + ); $lnk = $current ? wfMessage( 'currentrevisionlink' )->escaped() @@ -1631,10 +1637,11 @@ class Article implements Page { if ( $hasHistory ) { $title = $this->getTitle(); - // The following can use the real revision count as this is only being shown for users that can delete - // this page. - // This, as a side-effect, also makes sure that the following query isn't being run for pages with a - // larger history, unless the user has the 'bigdelete' right (and is about to delete this page). + // The following can use the real revision count as this is only being shown for users + // that can delete this page. + // This, as a side-effect, also makes sure that the following query isn't being run for + // pages with a larger history, unless the user has the 'bigdelete' right + // (and is about to delete this page). $dbr = wfGetDB( DB_SLAVE ); $revisions = $edits = (int)$dbr->selectField( 'revision', @@ -1644,7 +1651,8 @@ class Article implements Page { ); // @todo FIXME: i18n issue/patchwork message - $this->getContext()->getOutput()->addHTML( '' . + $this->getContext()->getOutput()->addHTML( + '' . wfMessage( 'historywarning' )->numParams( $revisions )->parse() . wfMessage( 'word-separator' )->plain() . Linker::linkKnown( $title, wfMessage( 'history' )->escaped(), diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 1b665f617e..e739a8622d 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -315,7 +315,8 @@ class DeletedContributionsPage extends SpecialPage { return; } - $options['limit'] = $request->getInt( 'limit', $this->getConfig()->get( 'QueryPageDefaultLimit' ) ); + $options['limit'] = $request->getInt( 'limit', + $this->getConfig()->get( 'QueryPageDefaultLimit' ) ); $options['target'] = $target; $userObj = User::newFromName( $target, false ); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index db83019d49..bc63e99a49 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -629,7 +629,10 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { private function buildRemoveLine( $title ) { $link = Linker::link( $title ); - $tools['talk'] = Linker::link( $title->getTalkPage(), $this->msg( 'talkpagelinktext' )->escaped() ); + $tools['talk'] = Linker::link( + $title->getTalkPage(), + $this->msg( 'talkpagelinktext' )->escaped() + ); if ( $title->exists() ) { $tools['history'] = Linker::linkKnown( diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index bf17a202a8..c08d11bbdc 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -203,7 +203,9 @@ class ImageListPager extends TablePager { } else { return false; } - } elseif ( $this->getConfig()->get( 'MiserMode' ) && $this->mShowAll /* && mUserName === null */ ) { + } elseif ( $this->getConfig()->get( 'MiserMode' ) + && $this->mShowAll /* && mUserName === null */ + ) { // no oi_timestamp index, so only alphabetical sorting in this case. if ( $field === 'img_name' ) { return true; diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index c3e871b840..a1f48e9fb0 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -1628,7 +1628,9 @@ class SpecialUndelete extends SpecialPage { } function undelete() { - if ( $this->getConfig()->get( 'UploadMaintenance' ) && $this->mTargetObj->getNamespace() == NS_FILE ) { + if ( $this->getConfig()->get( 'UploadMaintenance' ) + && $this->mTargetObj->getNamespace() == NS_FILE + ) { throw new ErrorPageError( 'undelete-error', 'filedelete-maintenance' ); } diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 7becfaae11..421840f05b 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -288,7 +288,9 @@ class SpecialWatchlist extends ChangesListSpecialPage { ); } - protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) { + protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, + &$join_conds, $opts + ) { return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts ) && wfRunHooks( 'SpecialWatchlistQuery', @@ -367,7 +369,9 @@ class SpecialWatchlist extends ChangesListSpecialPage { $updated = false; } - if ( $this->getConfig()->get( 'RCShowWatchingUsers' ) && $user->getOption( 'shownumberswatching' ) ) { + if ( $this->getConfig()->get( 'RCShowWatchingUsers' ) + && $user->getOption( 'shownumberswatching' ) + ) { $rc->numberofWatchingusers = $dbr->selectField( 'watchlist', 'COUNT(*)', array( @@ -503,7 +507,9 @@ class SpecialWatchlist extends ChangesListSpecialPage { $form .= $this->msg( 'nowatchlist' )->parse() . "\n"; } else { $form .= $this->msg( 'watchlist-details' )->numParams( $numItems )->parse() . "\n"; - if ( $this->getConfig()->get( 'EnotifWatchlist' ) && $user->getOption( 'enotifwatchlistpages' ) ) { + if ( $this->getConfig()->get( 'EnotifWatchlist' ) + && $user->getOption( 'enotifwatchlistpages' ) + ) { $form .= $this->msg( 'wlheader-enotif' )->parse() . "\n"; } if ( $showUpdatedMarker ) { diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index d2400b3f89..49c0108b50 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -403,7 +403,8 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->setTitle( NS_USER ); $this->setUserPerm( '' ); - $this->assertEquals( array( array( 'badaccess-group0' ), array( 'namespaceprotected', 'User', 'bogus' ) ), + $this->assertEquals( array( array( 'badaccess-group0' ), + array( 'namespaceprotected', 'User', 'bogus' ) ), $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); $this->setTitle( NS_MEDIAWIKI ); @@ -630,7 +631,8 @@ class TitlePermissionTest extends MediaWikiLangTestCase { $this->assertEquals( false, $this->title->userCan( 'bogus', $this->user ) ); - $this->assertEquals( array( array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n", 'bogus' ), + $this->assertEquals( array( + array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n", 'bogus' ), array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n", 'bogus' ), array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n", 'bogus' ) ), $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); diff --git a/tests/phpunit/includes/cache/RedisBloomCacheTest.php b/tests/phpunit/includes/cache/RedisBloomCacheTest.php index 3d491e9062..868d6c298c 100644 --- a/tests/phpunit/includes/cache/RedisBloomCacheTest.php +++ b/tests/phpunit/includes/cache/RedisBloomCacheTest.php @@ -57,7 +57,8 @@ class BloomCacheRedisTest extends MediaWikiTestCase { 'value2898', 'value2975' ); - $this->assertEquals( $eFalsePositives, $falsePositives, "Correct number of false positives found." ); + $this->assertEquals( $eFalsePositives, $falsePositives, + "Correct number of false positives found." ); } protected function tearDown() { -- 2.20.1