From 4be202e58b0b9e80c39c99dce5b5bc92bd728f16 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Fri, 17 May 2019 17:08:36 +0200 Subject: [PATCH] jobqueue: Remove duplicate property from DoubleRedirectJob All the stuff that is passed as $params to the constructor is stored in $this->params anyway. Change-Id: Idec1c243de7cdbb1e55dd754555536ce0ec2024d --- includes/jobqueue/jobs/DoubleRedirectJob.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/jobqueue/jobs/DoubleRedirectJob.php b/includes/jobqueue/jobs/DoubleRedirectJob.php index 1bcbd30c97..2c2cf89efc 100644 --- a/includes/jobqueue/jobs/DoubleRedirectJob.php +++ b/includes/jobqueue/jobs/DoubleRedirectJob.php @@ -29,10 +29,6 @@ use MediaWiki\MediaWikiServices; * @ingroup JobQueue */ class DoubleRedirectJob extends Job { - /** @var string Reason for the change, 'maintenance' or 'move'. Suffix fo - * message key 'double-redirect-fixed-'. - */ - private $reason; /** @var Title The title which has changed, redirects pointing to this * title are fixed @@ -44,11 +40,15 @@ class DoubleRedirectJob extends Job { /** * @param Title $title - * @param array $params + * @param array $params Expected to contain these elements: + * - 'redirTitle' => string The title that changed and should be fixed. + * - 'reason' => string Reason for the change, can be "move" or "maintenance". Used as a suffix + * for the message keys "double-redirect-fixed-move" and + * "double-redirect-fixed-maintenance". + * ] */ function __construct( Title $title, array $params ) { parent::__construct( 'fixDoubleRedirect', $title, $params ); - $this->reason = $params['reason']; $this->redirTitle = Title::newFromText( $params['redirTitle'] ); } @@ -166,7 +166,7 @@ class DoubleRedirectJob extends Job { $article = WikiPage::factory( $this->title ); // Messages: double-redirect-fixed-move, double-redirect-fixed-maintenance - $reason = wfMessage( 'double-redirect-fixed-' . $this->reason, + $reason = wfMessage( 'double-redirect-fixed-' . $this->params['reason'], $this->redirTitle->getPrefixedText(), $newTitle->getPrefixedText() )->inContentLanguage()->text(); $flags = EDIT_UPDATE | EDIT_SUPPRESS_RC | EDIT_INTERNAL; -- 2.20.1