Merge "Hard deprecate MWNamespace::canTalk()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 6 Mar 2019 15:11:07 +0000 (15:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 6 Mar 2019 15:11:07 +0000 (15:11 +0000)
includes/MWNamespace.php
includes/changes/ChangesFeed.php
tests/phpunit/includes/MWNamespaceTest.php

index 98e70bf..b40da00 100644 (file)
@@ -307,6 +307,7 @@ class MWNamespace {
         * @return bool True if this namespace either is or has a corresponding talk namespace.
         */
        public static function canTalk( $index ) {
+               wfDeprecated( __METHOD__, '1.30' );
                return self::hasTalkNamespace( $index );
        }
 
index fe9d24c..50c6826 100644 (file)
@@ -208,7 +208,7 @@ class ChangesFeed {
 
                foreach ( $sorted as $obj ) {
                        $title = Title::makeTitle( $obj->rc_namespace, $obj->rc_title );
-                       $talkpage = MWNamespace::canTalk( $obj->rc_namespace )
+                       $talkpage = MWNamespace::hasTalkNamespace( $obj->rc_namespace )
                                ? $title->getTalkPage()->getFullURL()
                                : '';
 
index 1b91a87..c95b1eb 100644 (file)
@@ -248,6 +248,7 @@ class MWNamespaceTest extends MediaWikiTestCase {
         * @param bool $expected
         */
        public function testCanTalk( $index, $expected ) {
+               $this->hideDeprecated( 'MWNamespace::canTalk' );
                $actual = MWNamespace::canTalk( $index );
                $this->assertSame( $actual, $expected, "NS $index" );
        }