Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95346
Change subject: Break long lines
......................................................................
Break long lines
Fixes CodeSniffer errors and warnigs.
Change-Id: Ic9cf4b9c677b3168d7c9820e2694080907997ee3
---
M includes/actions/CachedAction.php
M includes/actions/HistoryAction.php
M includes/actions/RawAction.php
M includes/actions/RevertAction.php
M includes/actions/RollbackAction.php
M includes/actions/WatchAction.php
6 files changed, 77 insertions(+), 24 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/46/95346/1
diff --git a/includes/actions/CachedAction.php
b/includes/actions/CachedAction.php
index f3ce25b..186ad46 100644
--- a/includes/actions/CachedAction.php
+++ b/includes/actions/CachedAction.php
@@ -133,7 +133,8 @@
* @param string|null $key
*/
public function addCachedHTML( $computeFunction, $args = array(), $key
= null ) {
- $this->getOutput()->addHTML(
$this->cacheHelper->getCachedValue( $computeFunction, $args, $key ) );
+ $html = $this->cacheHelper->getCachedValue( $computeFunction,
$args, $key );
+ $this->getOutput()->addHTML( $html );
}
/**
@@ -147,7 +148,8 @@
}
/**
- * Sets the time to live for the cache, in seconds or a unix timestamp
indicating the point of expiry.
+ * Sets the time to live for the cache, in seconds or a unix timestamp
+ * indicating the point of expiry.
*
* @since 1.20
*
diff --git a/includes/actions/HistoryAction.php
b/includes/actions/HistoryAction.php
index d9eba9c..687a460 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -180,7 +180,10 @@
) .
Html::hidden( 'title',
$this->getTitle()->getPrefixedDBkey() ) . "\n" .
Html::hidden( 'action', 'history' ) . "\n" .
- Xml::dateMenu( ( $year == null ?
MWTimestamp::getLocalInstance()->format( 'Y' ) : $year ), $month ) . ' ' .
+ Xml::dateMenu(
+ ( $year == null ?
MWTimestamp::getLocalInstance()->format( 'Y' ) : $year ),
+ $month
+ ) . ' ' .
( $tagSelector ? ( implode( ' ', $tagSelector ) .
' ' ) : '' ) .
$checkDeleted .
Xml::submitButton( $this->msg( 'allpagessubmit'
)->text() ) . "\n" .
@@ -535,10 +538,12 @@
* @todo document some more, and maybe clean up the code (some params
redundant?)
*
* @param $row Object: the database row corresponding to the previous
line.
- * @param $next Mixed: the database row corresponding to the next line.
(chronologically previous)
+ * @param $next Mixed: the database row corresponding to the next line
+ * (chronologically previous)
* @param $notificationtimestamp
* @param $latest Boolean: whether this row corresponds to the page's
latest revision.
- * @param $firstInList Boolean: whether this row corresponds to the
first displayed on this history page.
+ * @param $firstInList Boolean: whether this row corresponds to the
first
+ * displayed on this history page.
* @return String: HTML output for the row
*/
function historyLine( $row, $next, $notificationtimestamp = false,
@@ -555,12 +560,14 @@
$curlink = $this->curLink( $rev, $latest );
$lastlink = $this->lastLink( $rev, $next );
- $diffButtons = $this->diffButtons( $rev, $firstInList );
+ $curLastlinks = $curlink .
$this->historyPage->message['pipe-separator'] . $lastlink;
$histLinks = Html::rawElement(
'span',
array( 'class' => 'mw-history-histlinks' ),
- $this->msg( 'parentheses' )->rawParams( $curlink .
$this->historyPage->message['pipe-separator'] . $lastlink )->escaped()
+ $this->msg( 'parentheses' )->rawParams( $curLastlinks
)->escaped()
);
+
+ $diffButtons = $this->diffButtons( $rev, $firstInList );
$s = $histLinks . $diffButtons;
$link = $this->revLink( $rev );
@@ -634,7 +641,11 @@
if ( $prevRev && $this->getTitle()->quickUserCan( 'edit', $user
) ) {
if ( $latest && $this->getTitle()->quickUserCan(
'rollback', $user ) ) {
// Get a rollback link without the brackets
- $rollbackLink = Linker::generateRollback( $rev,
$this->getContext(), array( 'verify', 'noBrackets' ) );
+ $rollbackLink = Linker::generateRollback(
+ $rev,
+ $this->getContext(),
+ array( 'verify', 'noBrackets' )
+ );
if ( $rollbackLink ) {
$this->preventClickjacking();
$tools[] = $rollbackLink;
diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php
index 1213bfb..1a451b7 100644
--- a/includes/actions/RawAction.php
+++ b/includes/actions/RawAction.php
@@ -96,7 +96,9 @@
$privateCache = !User::isEveryoneAllowed( 'read' ) && (
$smaxage == 0 || session_id() != '' );
# allow the client to cache this for 24 hours
$mode = $privateCache ? 'private' : 'public';
- $response->header( 'Cache-Control: ' . $mode . ', s-maxage=' .
$smaxage . ', max-age=' . $maxage );
+ $response->header(
+ 'Cache-Control: ' . $mode . ', s-maxage=' . $smaxage .
', max-age=' . $maxage
+ );
$text = $this->getRawText();
@@ -135,8 +137,9 @@
// If it's a MediaWiki message we can just hit the message cache
if ( $request->getBool( 'usemsgcache' ) &&
$title->getNamespace() == NS_MEDIAWIKI ) {
- // The first "true" is to use the database, the second
is to use the content langue
- // and the last one is to specify the message key
already contains the language in it ("/de", etc.)
+ // The first "true" is to use the database, the second
is to use
+ // the content langue and the last one is to specify
the message
+ // key already contains the language in it ("/de",
etc.).
$text = MessageCache::singleton()->get(
$title->getDBkey(), true, true, true );
// If the message doesn't exist, return a blank
if ( $text === false ) {
@@ -178,7 +181,11 @@
}
if ( $text !== false && $text !== '' && $request->getVal(
'templates' ) === 'expand' ) {
- $text = $wgParser->preprocess( $text, $title,
ParserOptions::newFromContext( $this->getContext() ) );
+ $text = $wgParser->preprocess(
+ $text,
+ $title,
+ ParserOptions::newFromContext(
$this->getContext() )
+ );
}
return $text;
diff --git a/includes/actions/RevertAction.php
b/includes/actions/RevertAction.php
index 0a7ef9f..e5f1929 100644
--- a/includes/actions/RevertAction.php
+++ b/includes/actions/RevertAction.php
@@ -69,7 +69,11 @@
throw new ErrorPageError( 'internalerror',
'unexpected', array( 'oldimage', $oldimage ) );
}
- $this->oldFile =
RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->getTitle(),
$oldimage );
+ $this->oldFile =
RepoGroup::singleton()->getLocalRepo()->newFromArchiveName(
+ $this->getTitle(),
+ $oldimage
+ );
+
if ( !$this->oldFile->exists() ) {
throw new ErrorPageError( '', 'filerevert-badversion' );
}
@@ -100,8 +104,10 @@
'raw' => true,
'default' => $this->msg( 'filerevert-intro',
$this->getTitle()->getText(),
$userDate, $userTime,
- wfExpandUrl(
$this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage'
) ),
- PROTO_CURRENT )
)->parseAsBlock()
+ wfExpandUrl(
+
$this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage'
) ),
+ PROTO_CURRENT
+ ) )->parseAsBlock()
),
'comment' => array(
'type' => 'text',
@@ -113,11 +119,21 @@
}
public function onSubmit( $data ) {
- $source = $this->page->getFile()->getArchiveVirtualUrl(
$this->getRequest()->getText( 'oldimage' ) );
+ $source = $this->page->getFile()->getArchiveVirtualUrl(
+ $this->getRequest()->getText( 'oldimage' )
+ );
$comment = $data['comment'];
// TODO: Preserve file properties from database instead of
reloading from file
- return $this->page->getFile()->upload( $source, $comment,
$comment, 0, false, false, $this->getUser() );
+ return $this->page->getFile()->upload(
+ $source,
+ $comment,
+ $comment,
+ 0,
+ false,
+ false,
+ $this->getUser()
+ );
}
public function onSuccess() {
diff --git a/includes/actions/RollbackAction.php
b/includes/actions/RollbackAction.php
index 81bad9d..d48a0ea 100644
--- a/includes/actions/RollbackAction.php
+++ b/includes/actions/RollbackAction.php
@@ -53,7 +53,9 @@
throw new ThrottledError;
}
- if ( isset( $result[0][0] ) && ( $result[0][0] ==
'alreadyrolled' || $result[0][0] == 'cantrollback' ) ) {
+ if ( isset( $result[0][0] ) &&
+ ( $result[0][0] == 'alreadyrolled' || $result[0][0] ==
'cantrollback' )
+ ) {
$this->getOutput()->setPageTitle( $this->msg(
'rollbackfailed' ) );
$errArray = $result[0];
$errMsg = array_shift( $errArray );
@@ -91,12 +93,21 @@
$old = Linker::revUserTools( $current );
$new = Linker::revUserTools( $target );
- $this->getOutput()->addHTML( $this->msg( 'rollback-success'
)->rawParams( $old, $new )->parseAsBlock() );
+ $this->getOutput()->addHTML( $this->msg( 'rollback-success'
)->rawParams( $old, $new )
+ ->parseAsBlock() );
$this->getOutput()->returnToMain( false, $this->getTitle() );
- if ( !$request->getBool( 'hidediff', false ) &&
!$this->getUser()->getBoolOption( 'norollbackdiff', false ) ) {
+ if ( !$request->getBool( 'hidediff', false ) &&
+ !$this->getUser()->getBoolOption( 'norollbackdiff',
false )
+ ) {
$contentHandler = $current->getContentHandler();
- $de = $contentHandler->createDifferenceEngine(
$this->getContext(), $current->getId(), $newId, false, true );
+ $de = $contentHandler->createDifferenceEngine(
+ $this->getContext(),
+ $current->getId(),
+ $newId,
+ false,
+ true
+ );
$de->showDiff( '', '' );
}
}
diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php
index 054d615..e1b5d52 100644
--- a/includes/actions/WatchAction.php
+++ b/includes/actions/WatchAction.php
@@ -97,7 +97,9 @@
* @return Status
*/
public static function doWatchOrUnwatch( $watch, Title $title, User
$user ) {
- if ( $user->isLoggedIn() && $user->isWatched( $title,
WatchedItem::IGNORE_USER_RIGHTS ) != $watch ) {
+ if ( $user->isLoggedIn() &&
+ $user->isWatched( $title,
WatchedItem::IGNORE_USER_RIGHTS ) != $watch
+ ) {
// If the user doesn't have 'editmywatchlist', we still
want to
// allow them to add but not remove items via edits and
such.
if ( $watch ) {
@@ -118,8 +120,12 @@
* @param int $checkRights Passed through to $user->addWatch()
* @return Status
*/
- public static function doWatch( Title $title, User $user, $checkRights
= WatchedItem::CHECK_USER_RIGHTS ) {
- if ( $checkRights !== WatchedItem::IGNORE_USER_RIGHTS &&
!$user->isAllowed( 'editmywatchlist' ) ) {
+ public static function doWatch( Title $title, User $user,
+ $checkRights = WatchedItem::CHECK_USER_RIGHTS
+ ) {
+ if ( $checkRights !== WatchedItem::IGNORE_USER_RIGHTS &&
+ !$user->isAllowed( 'editmywatchlist' )
+ ) {
return User::newFatalPermissionDeniedStatus(
'editmywatchlist' );
}
--
To view, visit https://gerrit.wikimedia.org/r/95346
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9cf4b9c677b3168d7c9820e2694080907997ee3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits