From ab4feff3ca31a11ee8d1fbcd49941c13c4d9ac31 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Tue, 26 Feb 2019 19:24:27 -0800 Subject: [PATCH] Hard deprecate MWNamespace::canTalk() Deprecated in 1.30, it had 1 usage outside of tests, removing it in this patch. Change-Id: Ia88b004ac3a5d6f47ece1132f80f713d54a04654 --- includes/MWNamespace.php | 1 + includes/changes/ChangesFeed.php | 2 +- tests/phpunit/includes/MWNamespaceTest.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php index 98e70bf9f7..b40da00360 100644 --- a/includes/MWNamespace.php +++ b/includes/MWNamespace.php @@ -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 ); } diff --git a/includes/changes/ChangesFeed.php b/includes/changes/ChangesFeed.php index 7ac8cd0ed0..2b8c32c63e 100644 --- a/includes/changes/ChangesFeed.php +++ b/includes/changes/ChangesFeed.php @@ -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() : ''; diff --git a/tests/phpunit/includes/MWNamespaceTest.php b/tests/phpunit/includes/MWNamespaceTest.php index 1b91a87fb7..c95b1eb432 100644 --- a/tests/phpunit/includes/MWNamespaceTest.php +++ b/tests/phpunit/includes/MWNamespaceTest.php @@ -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" ); } -- 2.20.1