From f652b4b7a99c560e1e7b5cba7401b182b7996fb4 Mon Sep 17 00:00:00 2001 From: gladoscc Date: Thu, 1 Jan 2015 21:49:05 +1100 Subject: [PATCH] Add type hinting for WikiPage::onArticleEdit, etc Type hinting will catch false & null as specified in the todo. Change-Id: I64fade3a7aa5e15323dc63a13d84d969d0b942b3 --- includes/page/WikiPage.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index dcebe54216..7de7f27750 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3156,7 +3156,7 @@ class WikiPage implements Page, IDBAccessObject { * * @param Title $title */ - public static function onArticleCreate( $title ) { + public static function onArticleCreate( Title $title ) { // Update existence markers on article/talk tabs... $other = $title->getOtherPage(); @@ -3173,7 +3173,7 @@ class WikiPage implements Page, IDBAccessObject { * * @param Title $title */ - public static function onArticleDelete( $title ) { + public static function onArticleDelete( Title $title ) { // Update existence markers on article/talk tabs... $other = $title->getOtherPage(); @@ -3214,10 +3214,8 @@ class WikiPage implements Page, IDBAccessObject { * Purge caches on page update etc * * @param Title $title - * @todo Verify that $title is always a Title object (and never false or - * null), add Title hint to parameter $title. */ - public static function onArticleEdit( $title ) { + public static function onArticleEdit( Title $title ) { // Invalidate caches of articles which include this page DeferredUpdates::addHTMLCacheUpdate( $title, 'templatelinks' ); -- 2.20.1