jenkins-bot has submitted this change and it was merged.
Change subject: Address CodeSniffer errors and warnings
......................................................................
Address CodeSniffer errors and warnings
Change-Id: Ie119db7d6d9e9eb3c1cd9c07b8f84fd155847c62
---
M includes/changes/ChangesList.php
M includes/changes/EnhancedChangesList.php
M includes/changes/OldChangesList.php
M includes/changes/RecentChange.php
4 files changed, 64 insertions(+), 31 deletions(-)
Approvals:
Parent5446: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index fe5bf78..a45bc59 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -23,7 +23,6 @@
*/
class ChangesList extends ContextSource {
-
/**
* @var Skin
*/
@@ -140,8 +139,8 @@
$flag = $map[$flag];
}
- return "<abbr class='" . $flagInfos[$flag]['class'] . "'
title='" . $flagInfos[$flag]['title'] . "'>" .
- $flagInfos[$flag]['letter'] .
+ return "<abbr class='" . $flagInfos[$flag]['class'] . "'
title='" .
+ $flagInfos[$flag]['title'] . "'>" .
$flagInfos[$flag]['letter'] .
'</abbr>';
}
@@ -313,7 +312,9 @@
'action' => 'history'
)
);
- $s .= $this->msg( 'parentheses' )->rawParams( $diffhist
)->escaped() . ' <span class="mw-changeslist-separator">. .</span> ';
+ // @todo FIXME: Hard coded ". .". Is there a message for this?
Should there be?
+ $s .= $this->msg( 'parentheses' )->rawParams( $diffhist
)->escaped() .
+ ' <span class="mw-changeslist-separator">. .</span> ';
}
/**
@@ -353,8 +354,12 @@
* @return string HTML fragment
*/
public function getTimestamp( $rc ) {
+ // @todo FIXME: Hard coded ". .". Is there a message for this?
Should there be?
return $this->message['semicolon-separator'] . '<span
class="mw-changeslist-date">' .
- $this->getLanguage()->userTime(
$rc->mAttribs['rc_timestamp'], $this->getUser() ) . '</span> <span
class="mw-changeslist-separator">. .</span> ';
+ $this->getLanguage()->userTime(
+ $rc->mAttribs['rc_timestamp'],
+ $this->getUser()
+ ) . '</span> <span class="mw-changeslist-separator">.
.</span> ';
}
/**
@@ -375,7 +380,8 @@
*/
public function insertUserRelatedLinks( &$s, &$rc ) {
if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
- $s .= ' <span class="history-deleted">' . $this->msg(
'rev-deleted-user' )->escaped() . '</span>';
+ $s .= ' <span class="history-deleted">' .
+ $this->msg( 'rev-deleted-user' )->escaped() .
'</span>';
} else {
$s .= $this->getLanguage()->getDirMark() .
Linker::userLink( $rc->mAttribs['rc_user'],
$rc->mAttribs['rc_user_text'] );
@@ -405,7 +411,8 @@
public function insertComment( $rc ) {
if ( $rc->mAttribs['rc_type'] != RC_MOVE &&
$rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
if ( $this->isDeleted( $rc, Revision::DELETED_COMMENT )
) {
- return ' <span class="history-deleted">' .
$this->msg( 'rev-deleted-comment' )->escaped() . '</span>';
+ return ' <span class="history-deleted">' .
+ $this->msg( 'rev-deleted-comment'
)->escaped() . '</span>';
} else {
return Linker::commentBlock(
$rc->mAttribs['rc_comment'], $rc->getTitle() );
}
@@ -435,7 +442,8 @@
static $cache = array();
if ( $count > 0 ) {
if ( !isset( $cache[$count] ) ) {
- $cache[$count] = $this->msg(
'number_of_watching_users_RCview' )->numParams( $count )->escaped();
+ $cache[$count] = $this->msg(
'number_of_watching_users_RCview' )
+ ->numParams( $count )->escaped();
}
return $cache[$count];
} else {
@@ -488,12 +496,16 @@
* @param $rc RecentChange
*/
public function insertRollback( &$s, &$rc ) {
- if ( $rc->mAttribs['rc_type'] == RC_EDIT &&
$rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
+ if ( $rc->mAttribs['rc_type'] == RC_EDIT
+ && $rc->mAttribs['rc_this_oldid']
+ && $rc->mAttribs['rc_cur_id']
+ ) {
$page = $rc->getTitle();
/** Check for rollback and edit permissions, disallow
special pages, and only
* show a link on the top-most revision */
- if ( $this->getUser()->isAllowed( 'rollback' ) &&
$rc->mAttribs['page_latest'] == $rc->mAttribs['rc_this_oldid'] )
- {
+ if ( $this->getUser()->isAllowed( 'rollback' )
+ && $rc->mAttribs['page_latest'] ==
$rc->mAttribs['rc_this_oldid']
+ ) {
$rev = new Revision( array(
'title' => $page,
'id' => $rc->mAttribs['rc_this_oldid'],
@@ -516,7 +528,10 @@
return;
}
- list( $tagSummary, $newClasses ) =
ChangeTags::formatSummaryRow( $rc->mAttribs['ts_tags'], 'changeslist' );
+ list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow(
+ $rc->mAttribs['ts_tags'],
+ 'changeslist'
+ );
$classes = array_merge( $classes, $newClasses );
$s .= ' ' . $tagSummary;
}
diff --git a/includes/changes/EnhancedChangesList.php
b/includes/changes/EnhancedChangesList.php
index 3b724f1..4d6a4e7 100644
--- a/includes/changes/EnhancedChangesList.php
+++ b/includes/changes/EnhancedChangesList.php
@@ -98,7 +98,8 @@
$logtitle = SpecialPage::getTitleFor( 'Log',
$logType );
$logpage = new LogPage( $logType );
$logname = $logpage->getName()->escaped();
- $clink = $this->msg( 'parentheses'
)->rawParams( Linker::linkKnown( $logtitle, $logname ) )->escaped();
+ $clink = $this->msg( 'parentheses' )
+ ->rawParams( Linker::linkKnown(
$logtitle, $logname ) )->escaped();
} else {
$clink = Linker::link( $cacheEntry->getTitle()
);
}
@@ -162,7 +163,8 @@
# Make user links
if ( $this->isDeleted( $cacheEntry, Revision::DELETED_USER ) ) {
- $cacheEntry->userlink = ' <span
class="history-deleted">' . $this->msg( 'rev-deleted-user' )->escaped() .
'</span>';
+ $cacheEntry->userlink = ' <span
class="history-deleted">' .
+ $this->msg( 'rev-deleted-user' )->escaped() .
'</span>';
} else {
$cacheEntry->userlink = Linker::userLink(
$cacheEntry->mAttribs['rc_user'],
@@ -286,7 +288,9 @@
$text = $userlink;
$text .= $this->getLanguage()->getDirMark();
if ( $count > 1 ) {
- $text .= ' ' . $this->msg( 'parentheses'
)->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped();
+ // @todo FIXME: Hardcoded '×'. Should be a
message.
+ $formattedCount =
$this->getLanguage()->formatNum( $count ) . '×';
+ $text .= ' ' . $this->msg( 'parentheses'
)->rawParams( $formattedCount )->escaped();
}
array_push( $users, $text );
}
@@ -296,7 +300,8 @@
implode( $this->message['semicolon-separator'],
$users )
)->escaped() . '</span>';
- $tl = '<span class="mw-collapsible-toggle mw-collapsible-arrow
mw-enhancedchanges-arrow mw-enhancedchanges-arrow-space"></span>';
+ $tl = '<span class="mw-collapsible-toggle mw-collapsible-arrow
' .
+ 'mw-enhancedchanges-arrow
mw-enhancedchanges-arrow-space"></span>';
$r .= "<td>$tl</td>";
# Main line
@@ -312,7 +317,8 @@
# Article link
if ( $namehidden ) {
- $r .= ' <span class="history-deleted">' . $this->msg(
'rev-deleted-event' )->escaped() . '</span>';
+ $r .= ' <span class="history-deleted">' .
+ $this->msg( 'rev-deleted-event' )->escaped() .
'</span>';
} elseif ( $allLogs ) {
$r .= $this->maybeWatchedLink( $block[0]->link,
$block[0]->watched );
} else {
@@ -473,7 +479,11 @@
$r .= $link . '</span>';
if ( !$type == RC_LOG || $type == RC_NEW ) {
- $r .= ' ' . $this->msg( 'parentheses'
)->rawParams( $rcObj->curlink . $this->message['pipe-separator'] .
$rcObj->lastlink )->escaped();
+ $r .= ' ' . $this->msg( 'parentheses'
)->rawParams(
+ $rcObj->curlink .
+
$this->message['pipe-separator'] .
+ $rcObj->lastlink
+ )->escaped();
}
$r .= ' <span class="mw-changeslist-separator">.
.</span> ';
@@ -598,19 +608,21 @@
$logPage = new LogPage( $logType );
$logTitle = SpecialPage::getTitleFor( 'Log', $logType );
$logName = $logPage->getName()->escaped();
- $r .= $this->msg( 'parentheses' )->rawParams(
Linker::linkKnown( $logTitle, $logName ) )->escaped();
+ $r .= $this->msg( 'parentheses' )
+ ->rawParams( Linker::linkKnown( $logTitle,
$logName ) )->escaped();
} else {
$this->insertArticleLink( $r, $rcObj,
$rcObj->unpatrolled, $rcObj->watched );
}
# Diff and hist links
if ( $type != RC_LOG ) {
$query['action'] = 'history';
- $r .= ' ' . $this->msg( 'parentheses' )->rawParams(
$rcObj->difflink . $this->message['pipe-separator'] . Linker::linkKnown(
- $rcObj->getTitle(),
- $this->message['hist'],
- array(),
- $query
- ) )->escaped();
+ $r .= ' ' . $this->msg( 'parentheses' )
+ ->rawParams( $rcObj->difflink .
$this->message['pipe-separator'] . Linker::linkKnown(
+ $rcObj->getTitle(),
+ $this->message['hist'],
+ array(),
+ $query
+ ) )->escaped();
}
$r .= ' <span class="mw-changeslist-separator">. .</span> ';
# Character diff
diff --git a/includes/changes/OldChangesList.php
b/includes/changes/OldChangesList.php
index a7fe934..e9a6a43 100644
--- a/includes/changes/OldChangesList.php
+++ b/includes/changes/OldChangesList.php
@@ -116,7 +116,8 @@
}
if ( $this->watchlist ) {
- $classes[] = Sanitizer::escapeClass( 'watchlist-' .
$rc->mAttribs['rc_namespace'] . '-' . $rc->mAttribs['rc_title'] );
+ $classes[] = Sanitizer::escapeClass( 'watchlist-' .
+ $rc->mAttribs['rc_namespace'] . '-' .
$rc->mAttribs['rc_title'] );
}
if ( !wfRunHooks( 'OldChangesListRecentChangesLine', array(
&$this, &$s, $rc, &$classes ) ) ) {
diff --git a/includes/changes/RecentChange.php
b/includes/changes/RecentChange.php
index 48a8d03..5c5907d 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -406,7 +406,8 @@
/**
* Mark this RecentChange as patrolled
*
- * NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and
'markedaspatrollederror-noautopatrol' as errors
+ * NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and
+ * 'markedaspatrollederror-noautopatrol' as errors
* @param $user User object doing the action
* @param $auto Boolean: for automatic patrol
* @return array of permissions errors, see
Title::getUserPermissionsErrors()
@@ -427,7 +428,9 @@
}
// Users without the 'autopatrol' right can't patrol their
// own revisions
- if ( $user->getName() == $this->getAttribute( 'rc_user_text' )
&& !$user->isAllowed( 'autopatrol' ) ) {
+ if ( $user->getName() == $this->getAttribute( 'rc_user_text' )
+ && !$user->isAllowed( 'autopatrol' )
+ ) {
$errors[] = array(
'markedaspatrollederror-noautopatrol' );
}
if ( $errors ) {
@@ -602,9 +605,10 @@
* @return bool
*/
public static function notifyLog( $timestamp, &$title, &$user,
$actionComment, $ip, $type,
- $action, $target, $logComment, $params, $newId = 0,
$actionCommentIRC = '' )
- {
+ $action, $target, $logComment, $params, $newId = 0,
$actionCommentIRC = ''
+ ) {
global $wgLogRestrictions;
+
# Don't add private logs to RC!
if ( isset( $wgLogRestrictions[$type] ) &&
$wgLogRestrictions[$type] != '*' ) {
return false;
@@ -826,7 +830,8 @@
global $wgRequest;
if ( $ip ) {
if ( !IP::isIPAddress( $ip ) ) {
- throw new MWException( "Attempt to write \"" .
$ip . "\" as an IP address into recent changes" );
+ throw new MWException( "Attempt to write \"" .
$ip .
+ "\" as an IP address into recent
changes" );
}
} else {
$ip = $wgRequest->getIP();
--
To view, visit https://gerrit.wikimedia.org/r/96155
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie119db7d6d9e9eb3c1cd9c07b8f84fd155847c62
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits