Unicodesnowman has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/182409

Change subject: Add type hinting for WikiPage::onArticleEdit, etc
......................................................................

Add type hinting for WikiPage::onArticleEdit, etc

Type hinting will catch false & null as specified in the todo.

Change-Id: I64fade3a7aa5e15323dc63a13d84d969d0b942b3
---
M includes/page/WikiPage.php
1 file changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/182409/1

diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index dcebe54..7de7f27 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -3156,7 +3156,7 @@
         *
         * @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 @@
         *
         * @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 @@
         * 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' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/182409
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64fade3a7aa5e15323dc63a13d84d969d0b942b3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Unicodesnowman <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to