From 4058234570a5cf98b301ad3d8dce3261da189a80 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 28 Sep 2015 10:13:31 -0700 Subject: [PATCH] Code cleanups and simplifications to SpecialMergeHistory * Fixed all IDEA errors for this file Change-Id: I5cbb660c1a138ce7a8bf023929d97f1c75f0a80a --- includes/specials/SpecialMergeHistory.php | 25 ++++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index 7edf961acd..145a12a682 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -61,6 +61,9 @@ class SpecialMergeHistory extends SpecialPage { /** @var Title */ protected $mDestObj; + /** @var int[] */ + public $prevId; + public function __construct() { parent::__construct( 'MergeHistory', 'mergehistory' ); } @@ -94,18 +97,6 @@ class SpecialMergeHistory extends SpecialPage { $this->mTargetObj = null; $this->mDestObj = null; } - $this->preCacheMessages(); - } - - /** - * As we use the same small set of messages in various methods and that - * they are called often, we call them once and save them in $this->message - */ - function preCacheMessages() { - // Precache various messages - if ( !isset( $this->message ) ) { - $this->message['last'] = $this->msg( 'last' )->escaped(); - } } public function execute( $par ) { @@ -283,7 +274,7 @@ class SpecialMergeHistory extends SpecialPage { $rev = new Revision( $row ); $stxt = ''; - $last = $this->message['last']; + $last = $this->msg( 'last' )->escaped(); $ts = wfTimestamp( TS_MW, $row->rev_timestamp ); $checkBox = Xml::radio( 'mergepoint', $ts, ( $this->mTimestamp === $ts ) ); @@ -302,11 +293,11 @@ class SpecialMergeHistory extends SpecialPage { # Last link if ( !$rev->userCan( Revision::DELETED_TEXT, $user ) ) { - $last = $this->message['last']; + $last = $this->msg( 'last' )->escaped(); } elseif ( isset( $this->prevId[$row->rev_id] ) ) { $last = Linker::linkKnown( $rev->getTitle(), - $this->message['last'], + $this->msg( 'last' )->escaped(), array(), array( 'diff' => $row->rev_id, @@ -501,13 +492,13 @@ class SpecialMergeHistory extends SpecialPage { } class MergeHistoryPager extends ReverseChronologicalPager { - /** @var IContextSource */ + /** @var SpecialMergeHistory */ public $mForm; /** @var array */ public $mConds; - function __construct( $form, $conds, $source, $dest ) { + function __construct( SpecialMergeHistory $form, $conds, Title $source, Title $dest ) { $this->mForm = $form; $this->mConds = $conds; $this->title = $source; -- 2.20.1