From 98b88146d77f56f2f5465b562ca6a5f64abb35e4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 22 Oct 2015 13:25:49 -0700 Subject: [PATCH] Make LinksUpdate::__construct() use normal type hints Change-Id: Ie5f4de95d07ac9f24e415f92c5116385863a47f9 --- includes/deferred/LinksUpdate.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 5a7efca152..0348a1aa47 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -85,25 +85,16 @@ class LinksUpdate extends SqlDataUpdate implements EnqueueableDataUpdate { * @param bool $recursive Queue jobs for recursive updates? * @throws MWException */ - function __construct( $title, $parserOutput, $recursive = true ) { + function __construct( Title $title, ParserOutput $parserOutput, $recursive = true ) { parent::__construct( false ); // no implicit transaction - if ( !( $title instanceof Title ) ) { - throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " . - "Please see Article::editUpdates() for an invocation example.\n" ); - } - - if ( !( $parserOutput instanceof ParserOutput ) ) { - throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " . - "Please see WikiPage::doEditUpdates() for an invocation example.\n" ); - } - $this->mTitle = $title; $this->mId = $title->getArticleID(); if ( !$this->mId ) { - throw new MWException( "The Title object did not provide an article " . - "ID. Perhaps the page doesn't exist?" ); + throw new InvalidArgumentException( + "The Title object yields no ID. Perhaps the page doesn't exist?" + ); } $this->mParserOutput = $parserOutput; -- 2.20.1