Siebrand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/96156


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, 112 insertions(+), 86 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/96156/1

diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index ca72fa0..56a54ae 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 7298d2f..a8bfee9 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';
@@ -466,11 +466,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> ';
                                }
@@ -529,6 +529,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\" />";
        }
 
@@ -539,6 +540,7 @@
         */
        protected function sideArrow() {
                $dir = $this->getLanguage()->isRTL() ? 'l' : 'r';
+
                return $this->arrow( $dir, '+', $this->msg( 
'rc-enhanced-expand' )->text() );
        }
 
@@ -577,10 +579,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';
@@ -614,12 +616,12 @@
                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();
+                               ->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
@@ -657,7 +659,7 @@
         * @return string
         */
        protected function recentChangesBlock() {
-               if ( count ( $this->rc_cache ) == 0 ) {
+               if ( count( $this->rc_cache ) == 0 ) {
                        return '';
                }
 
@@ -685,5 +687,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: newchange
Gerrit-Change-Id: I7586c4d50f7332c515b8377749c4250cc9e04d83
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

Reply via email to