From: Aaron Schulz Date: Thu, 22 Oct 2015 20:25:49 +0000 (-0700) Subject: Make LinksUpdate::__construct() use normal type hints X-Git-Tag: 1.31.0-rc.0~9292^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=98b88146d77f56f2f5465b562ca6a5f64abb35e4;p=lhc%2Fweb%2Fwiklou.git Make LinksUpdate::__construct() use normal type hints Change-Id: Ie5f4de95d07ac9f24e415f92c5116385863a47f9 --- 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;