Hard deprecate MWNamespace::canTalk()
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 27 Feb 2019 03:24:27 +0000 (19:24 -0800)
committerMax Semenik <maxsem.wiki@gmail.com>
Wed, 27 Feb 2019 05:28:55 +0000 (21:28 -0800)
Deprecated in 1.30, it had 1 usage outside of tests, removing it in
this patch.

Change-Id: Ia88b004ac3a5d6f47ece1132f80f713d54a04654

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 7ac8cd0..2b8c32c 100644 (file)
@@ -207,7 +207,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" );
        }