Add type hinting for WikiPage::onArticleEdit, etc
authorgladoscc <admin@glados.cc>
Thu, 1 Jan 2015 10:49:05 +0000 (21:49 +1100)
committerUmherirrender <umherirrender_de.wp@web.de>
Wed, 7 Jan 2015 18:55:28 +0000 (18:55 +0000)
Type hinting will catch false & null as specified in the todo.

Change-Id: I64fade3a7aa5e15323dc63a13d84d969d0b942b3

includes/page/WikiPage.php

index dcebe54..7de7f27 100644 (file)
@@ -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' );