jenkins-bot has submitted this change and it was merged.
Change subject: Update formatting
......................................................................
Update formatting
Change-Id: I7586c4d50f7332c515b8377749c4250cc9e04d83
---
M includes/changes/ChangesList.php
M includes/changes/EnhancedChangesList.php
M includes/changes/OldChangesList.php
M includes/changes/RCCacheEntry.php
M includes/changes/RecentChange.php
5 files changed, 106 insertions(+), 80 deletions(-)
Approvals:
Parent5446: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index a45bc59..aa3519b 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -61,6 +61,7 @@
$list = null;
if ( wfRunHooks( 'FetchChangesList', array( $user, &$sk, &$list
) ) ) {
$new = $context->getRequest()->getBool( 'enhanced',
$user->getOption( 'usenewrc' ) );
+
return $new ? new EnhancedChangesList( $context ) : new
OldChangesList( $context );
} else {
return $list;
@@ -104,6 +105,7 @@
? self::flag( $flag )
: $nothing;
}
+
return $f;
}
@@ -155,6 +157,7 @@
$this->lastdate = '';
$this->rclistOpen = false;
$this->getOutput()->addModuleStyles(
'mediawiki.special.changeslist' );
+
return '';
}
@@ -400,6 +403,7 @@
$formatter->setContext( $this->getContext() );
$formatter->setShowUserToolLinks( true );
$mark = $this->getLanguage()->getDirMark();
+
return $formatter->getActionText() . " $mark" .
$formatter->getComment();
}
@@ -417,6 +421,7 @@
return Linker::commentBlock(
$rc->mAttribs['rc_comment'], $rc->getTitle() );
}
}
+
return '';
}
@@ -445,6 +450,7 @@
$cache[$count] = $this->msg(
'number_of_watching_users_RCview' )
->numParams( $count )->escaped();
}
+
return $cache[$count];
} else {
return '';
@@ -502,7 +508,7 @@
) {
$page = $rc->getTitle();
/** Check for rollback and edit permissions, disallow
special pages, and only
- * show a link on the top-most revision */
+ * show a link on the top-most revision */
if ( $this->getUser()->isAllowed( 'rollback' )
&& $rc->mAttribs['page_latest'] ==
$rc->mAttribs['rc_this_oldid']
) {
diff --git a/includes/changes/EnhancedChangesList.php
b/includes/changes/EnhancedChangesList.php
index 4d6a4e7..4837525 100644
--- a/includes/changes/EnhancedChangesList.php
+++ b/includes/changes/EnhancedChangesList.php
@@ -220,10 +220,10 @@
if ( $block[0]->mAttribs['rc_log_type'] ) {
# Log entry
$classes[] = Sanitizer::escapeClass(
'mw-changeslist-log-'
- . $block[0]->mAttribs['rc_log_type'] .
'-' . $block[0]->mAttribs['rc_title'] );
+ . $block[0]->mAttribs['rc_log_type'] . '-' .
$block[0]->mAttribs['rc_title'] );
} else {
$classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns'
- . $block[0]->mAttribs['rc_namespace'] .
'-' . $block[0]->mAttribs['rc_title'] );
+ . $block[0]->mAttribs['rc_namespace'] . '-' .
$block[0]->mAttribs['rc_title'] );
}
$classes[] = $block[0]->watched &&
$block[0]->mAttribs['rc_timestamp'] >= $block[0]->watched
? 'mw-changeslist-line-watched' :
'mw-changeslist-line-not-watched';
@@ -467,11 +467,11 @@
} else {
$link = Linker::linkKnown(
- $rcObj->getTitle(),
- $rcObj->timestamp,
- array(),
- $params
- );
+ $rcObj->getTitle(),
+ $rcObj->timestamp,
+ array(),
+ $params
+ );
if ( $this->isDeleted( $rcObj,
Revision::DELETED_TEXT ) ) {
$link = '<span
class="history-deleted">' . $link . '</span> ';
}
@@ -532,6 +532,7 @@
$encUrl = htmlspecialchars( $wgStylePath .
'/common/images/Arr_' . $dir . '.png' );
$encAlt = htmlspecialchars( $alt );
$encTitle = htmlspecialchars( $title );
+
return "<img src=\"$encUrl\" width=\"12\" height=\"12\"
alt=\"$encAlt\" title=\"$encTitle\" />";
}
@@ -542,6 +543,7 @@
*/
protected function sideArrow() {
$dir = $this->getLanguage()->isRTL() ? 'l' : 'r';
+
return $this->arrow( $dir, '+', $this->msg(
'rc-enhanced-expand' )->text() );
}
@@ -580,10 +582,10 @@
if ( $logType ) {
# Log entry
$classes[] = Sanitizer::escapeClass(
'mw-changeslist-log-'
- . $logType . '-' .
$rcObj->mAttribs['rc_title'] );
+ . $logType . '-' . $rcObj->mAttribs['rc_title']
);
} else {
$classes[] = Sanitizer::escapeClass(
'mw-changeslist-ns' .
- $rcObj->mAttribs['rc_namespace'] . '-'
. $rcObj->mAttribs['rc_title'] );
+ $rcObj->mAttribs['rc_namespace'] . '-' .
$rcObj->mAttribs['rc_title'] );
}
$classes[] = $rcObj->watched &&
$rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched
? 'mw-changeslist-line-watched' :
'mw-changeslist-line-not-watched';
@@ -660,7 +662,7 @@
* @return string
*/
protected function recentChangesBlock() {
- if ( count ( $this->rc_cache ) == 0 ) {
+ if ( count( $this->rc_cache ) == 0 ) {
return '';
}
@@ -688,5 +690,4 @@
public function endRecentChangesList() {
return $this->recentChangesBlock() .
parent::endRecentChangesList();
}
-
}
diff --git a/includes/changes/OldChangesList.php
b/includes/changes/OldChangesList.php
index e9a6a43..bcdb33e 100644
--- a/includes/changes/OldChangesList.php
+++ b/includes/changes/OldChangesList.php
@@ -122,10 +122,12 @@
if ( !wfRunHooks( 'OldChangesListRecentChangesLine', array(
&$this, &$s, $rc, &$classes ) ) ) {
wfProfileOut( __METHOD__ );
+
return false;
}
wfProfileOut( __METHOD__ );
+
return "$dateheader<li class=\"" . implode( ' ', $classes ) .
"\">" . $s . "</li>\n";
}
}
diff --git a/includes/changes/RCCacheEntry.php
b/includes/changes/RCCacheEntry.php
index 9aef3d3..3fa5c32 100644
--- a/includes/changes/RCCacheEntry.php
+++ b/includes/changes/RCCacheEntry.php
@@ -30,6 +30,7 @@
$rc2 = new RCCacheEntry;
$rc2->mAttribs = $rc->mAttribs;
$rc2->mExtra = $rc->mExtra;
+
return $rc2;
}
}
diff --git a/includes/changes/RecentChange.php
b/includes/changes/RecentChange.php
index 5c5907d..a6920f6 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -100,6 +100,7 @@
public static function newFromRow( $row ) {
$rc = new RecentChange;
$rc->loadFromRow( $row );
+
return $rc;
}
@@ -114,6 +115,7 @@
$rc->loadFromCurRow( $row );
$rc->notificationtimestamp = false;
$rc->numberofWatchingusers = false;
+
return $rc;
}
@@ -203,6 +205,7 @@
if ( $this->mTitle === false ) {
$this->mTitle = Title::makeTitle(
$this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
}
+
return $this->mTitle;
}
@@ -219,6 +222,7 @@
$this->mPerformer = User::newFromName(
$this->mAttribs['rc_user_text'], false );
}
}
+
return $this->mPerformer;
}
@@ -380,6 +384,7 @@
*/
public static function cleanupForIRC( $text ) {
wfDeprecated( __METHOD__, '1.22' );
+
return IRCColourfulRCFeedFormatter::cleanupForIRC( $text );
}
@@ -400,6 +405,7 @@
if ( !$change instanceof RecentChange ) {
return null;
}
+
return $change->doMarkPatrolled( $wgUser, $auto );
}
@@ -445,6 +451,7 @@
// Log this patrol event
PatrolLog::record( $this, $auto, $user );
wfRunHooks( 'MarkPatrolledComplete', array(
$this->getAttribute( 'rc_id' ), &$user, false ) );
+
return array();
}
@@ -467,6 +474,7 @@
// Invalidate the page cache after the page has been patrolled
// to make sure that the Patrol link isn't visible any longer!
$this->getTitle()->invalidateCache();
+
return $dbw->affectedRows();
}
@@ -494,39 +502,40 @@
$rc->mTitle = $title;
$rc->mPerformer = $user;
$rc->mAttribs = array(
- 'rc_timestamp' => $timestamp,
- 'rc_namespace' => $title->getNamespace(),
- 'rc_title' => $title->getDBkey(),
- 'rc_type' => RC_EDIT,
- 'rc_source' => self::SRC_EDIT,
- 'rc_minor' => $minor ? 1 : 0,
- 'rc_cur_id' => $title->getArticleID(),
- 'rc_user' => $user->getId(),
- 'rc_user_text' => $user->getName(),
- 'rc_comment' => $comment,
+ 'rc_timestamp' => $timestamp,
+ 'rc_namespace' => $title->getNamespace(),
+ 'rc_title' => $title->getDBkey(),
+ 'rc_type' => RC_EDIT,
+ 'rc_source' => self::SRC_EDIT,
+ 'rc_minor' => $minor ? 1 : 0,
+ 'rc_cur_id' => $title->getArticleID(),
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_comment' => $comment,
'rc_this_oldid' => $newId,
'rc_last_oldid' => $oldId,
- 'rc_bot' => $bot ? 1 : 0,
- 'rc_ip' => self::checkIPAddress( $ip ),
- 'rc_patrolled' => intval( $patrol ),
- 'rc_new' => 0, # obsolete
- 'rc_old_len' => $oldSize,
- 'rc_new_len' => $newSize,
- 'rc_deleted' => 0,
- 'rc_logid' => 0,
- 'rc_log_type' => null,
+ 'rc_bot' => $bot ? 1 : 0,
+ 'rc_ip' => self::checkIPAddress( $ip ),
+ 'rc_patrolled' => intval( $patrol ),
+ 'rc_new' => 0, # obsolete
+ 'rc_old_len' => $oldSize,
+ 'rc_new_len' => $newSize,
+ 'rc_deleted' => 0,
+ 'rc_logid' => 0,
+ 'rc_log_type' => null,
'rc_log_action' => '',
- 'rc_params' => ''
+ 'rc_params' => ''
);
$rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => $lastTimestamp,
- 'oldSize' => $oldSize,
- 'newSize' => $newSize,
- 'pageStatus' => 'changed'
+ 'oldSize' => $oldSize,
+ 'newSize' => $newSize,
+ 'pageStatus' => 'changed'
);
$rc->save();
+
return $rc;
}
@@ -553,29 +562,29 @@
$rc->mTitle = $title;
$rc->mPerformer = $user;
$rc->mAttribs = array(
- 'rc_timestamp' => $timestamp,
- 'rc_namespace' => $title->getNamespace(),
- 'rc_title' => $title->getDBkey(),
- 'rc_type' => RC_NEW,
- 'rc_source' => self::SRC_NEW,
- 'rc_minor' => $minor ? 1 : 0,
- 'rc_cur_id' => $title->getArticleID(),
- 'rc_user' => $user->getId(),
- 'rc_user_text' => $user->getName(),
- 'rc_comment' => $comment,
- 'rc_this_oldid' => $newId,
- 'rc_last_oldid' => 0,
- 'rc_bot' => $bot ? 1 : 0,
- 'rc_ip' => self::checkIPAddress( $ip ),
- 'rc_patrolled' => intval( $patrol ),
- 'rc_new' => 1, # obsolete
- 'rc_old_len' => 0,
- 'rc_new_len' => $size,
- 'rc_deleted' => 0,
- 'rc_logid' => 0,
- 'rc_log_type' => null,
- 'rc_log_action' => '',
- 'rc_params' => ''
+ 'rc_timestamp' => $timestamp,
+ 'rc_namespace' => $title->getNamespace(),
+ 'rc_title' => $title->getDBkey(),
+ 'rc_type' => RC_NEW,
+ 'rc_source' => self::SRC_NEW,
+ 'rc_minor' => $minor ? 1 : 0,
+ 'rc_cur_id' => $title->getArticleID(),
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_comment' => $comment,
+ 'rc_this_oldid' => $newId,
+ 'rc_last_oldid' => 0,
+ 'rc_bot' => $bot ? 1 : 0,
+ 'rc_ip' => self::checkIPAddress( $ip ),
+ 'rc_patrolled' => intval( $patrol ),
+ 'rc_new' => 1, # obsolete
+ 'rc_old_len' => 0,
+ 'rc_new_len' => $size,
+ 'rc_deleted' => 0,
+ 'rc_logid' => 0,
+ 'rc_log_type' => null,
+ 'rc_log_action' => '',
+ 'rc_params' => ''
);
$rc->mExtra = array(
@@ -586,6 +595,7 @@
'pageStatus' => 'created'
);
$rc->save();
+
return $rc;
}
@@ -616,6 +626,7 @@
$rc = self::newLogEntry( $timestamp, $title, $user,
$actionComment, $ip, $type, $action,
$target, $logComment, $params, $newId,
$actionCommentIRC );
$rc->save();
+
return true;
}
@@ -663,38 +674,39 @@
$rc->mTitle = $target;
$rc->mPerformer = $user;
$rc->mAttribs = array(
- 'rc_timestamp' => $timestamp,
- 'rc_namespace' => $target->getNamespace(),
- 'rc_title' => $target->getDBkey(),
- 'rc_type' => RC_LOG,
- 'rc_source' => self::SRC_LOG,
- 'rc_minor' => 0,
- 'rc_cur_id' => $target->getArticleID(),
- 'rc_user' => $user->getId(),
- 'rc_user_text' => $user->getName(),
- 'rc_comment' => $logComment,
+ 'rc_timestamp' => $timestamp,
+ 'rc_namespace' => $target->getNamespace(),
+ 'rc_title' => $target->getDBkey(),
+ 'rc_type' => RC_LOG,
+ 'rc_source' => self::SRC_LOG,
+ 'rc_minor' => 0,
+ 'rc_cur_id' => $target->getArticleID(),
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_comment' => $logComment,
'rc_this_oldid' => 0,
'rc_last_oldid' => 0,
- 'rc_bot' => $user->isAllowed( 'bot' ) ?
$wgRequest->getBool( 'bot', true ) : 0,
- 'rc_ip' => self::checkIPAddress( $ip ),
- 'rc_patrolled' => 1,
- 'rc_new' => 0, # obsolete
- 'rc_old_len' => null,
- 'rc_new_len' => null,
- 'rc_deleted' => 0,
- 'rc_logid' => $newId,
- 'rc_log_type' => $type,
+ 'rc_bot' => $user->isAllowed( 'bot' ) ?
$wgRequest->getBool( 'bot', true ) : 0,
+ 'rc_ip' => self::checkIPAddress( $ip ),
+ 'rc_patrolled' => 1,
+ 'rc_new' => 0, # obsolete
+ 'rc_old_len' => null,
+ 'rc_new_len' => null,
+ 'rc_deleted' => 0,
+ 'rc_logid' => $newId,
+ 'rc_log_type' => $type,
'rc_log_action' => $action,
- 'rc_params' => $params
+ 'rc_params' => $params
);
$rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => 0,
'actionComment' => $actionComment, // the comment
appended to the action, passed from LogPage
- 'pageStatus' => $pageStatus,
+ 'pageStatus' => $pageStatus,
'actionCommentIRC' => $actionCommentIRC
);
+
return $rc;
}
@@ -780,6 +792,7 @@
} else {
$trail = '';
}
+
return $trail;
}
@@ -800,6 +813,7 @@
if ( $old === null || $new === null ) {
return '';
}
+
return ChangesList::showCharacterDifference( $old, $new );
}
@@ -814,7 +828,7 @@
$method = __METHOD__;
$dbw = wfGetDB( DB_MASTER );
- $dbw->onTransactionIdle( function() use ( $dbw, $method ) {
+ $dbw->onTransactionIdle( function () use ( $dbw, $method ) {
global $wgRCMaxAge;
$cutoff = $dbw->timestamp( time() - $wgRCMaxAge );
@@ -839,6 +853,7 @@
$ip = '';
}
}
+
return $ip;
}
@@ -853,6 +868,7 @@
*/
public static function isInRCLifespan( $timestamp, $tolerance = 0 ) {
global $wgRCMaxAge;
+
return wfTimestamp( TS_UNIX, $timestamp ) > time() - $tolerance
- $wgRCMaxAge;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/96156
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7586c4d50f7332c515b8377749c4250cc9e04d83
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Parent5446 <[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