From: withoutaname Date: Tue, 8 Jul 2014 08:09:19 +0000 (-0700) Subject: Enforce type hinting for setTitle() in IContextSource subclasses X-Git-Tag: 1.31.0-rc.0~14968 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=a395db765bb5c5223402bedfc601862301cc9387;p=lhc%2Fweb%2Fwiklou.git Enforce type hinting for setTitle() in IContextSource subclasses Change-Id: Iecd8535b04072823a6f4efe33697148f4d20118e --- diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index f550e9e6cf..d78f420a38 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -126,12 +126,8 @@ class DerivativeContext extends ContextSource { * Set the Title object * * @param Title $t - * @throws MWException */ - public function setTitle( $t ) { - if ( $t !== null && !$t instanceof Title ) { - throw new MWException( __METHOD__ . " expects an instance of Title" ); - } + public function setTitle( Title $t ) { $this->title = $t; } diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index d4bf0b4fa8..cd18404846 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -124,12 +124,8 @@ class RequestContext implements IContextSource { * Set the Title object * * @param Title $t - * @throws MWException */ - public function setTitle( $t ) { - if ( $t !== null && !$t instanceof Title ) { - throw new MWException( __METHOD__ . " expects an instance of Title" ); - } + public function setTitle( Title $t ) { $this->title = $t; // Erase the WikiPage so a new one with the new title gets created. $this->wikipage = null;