From 07628545608ec742dd21fd83f47b1552b898d3b4 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 30 Jul 2018 17:57:53 +0300 Subject: [PATCH] Hard-deprecate MagicWord static methods Bug: T200247 Change-Id: Ib36e78274f42ddbeaa7801cc8bad77b991a4a1aa --- includes/MagicWord.php | 5 +++++ tests/phpunit/includes/api/ApiQuerySiteinfoTest.php | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 4420d1d327..3c77234336 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -125,6 +125,7 @@ class MagicWord { * @deprecated since 1.32, use MagicWordFactory::get */ public static function get( $id ) { + wfDeprecated( __METHOD__, '1.32' ); return MediaWikiServices::getInstance()->getMagicWordFactory()->get( $id ); } @@ -135,6 +136,7 @@ class MagicWord { * @deprecated since 1.32, use MagicWordFactory::getVariableIDs */ public static function getVariableIDs() { + wfDeprecated( __METHOD__, '1.32' ); return MediaWikiServices::getInstance()->getMagicWordFactory()->getVariableIDs(); } @@ -144,6 +146,7 @@ class MagicWord { * @deprecated since 1.32, use MagicWordFactory::getSubstIDs */ public static function getSubstIDs() { + wfDeprecated( __METHOD__, '1.32' ); return MediaWikiServices::getInstance()->getMagicWordFactory()->getSubstIDs(); } @@ -155,6 +158,7 @@ class MagicWord { * @deprecated since 1.32, use MagicWordFactory::getCacheTTL */ public static function getCacheTTL( $id ) { + wfDeprecated( __METHOD__, '1.32' ); return MediaWikiServices::getInstance()->getMagicWordFactory()->getCacheTTL( $id ); } @@ -165,6 +169,7 @@ class MagicWord { * @deprecated since 1.32, use MagicWordFactory::getDoubleUnderscoreArray */ public static function getDoubleUnderscoreArray() { + wfDeprecated( __METHOD__, '1.32' ); return MediaWikiServices::getInstance()->getMagicWordFactory()->getDoubleUnderscoreArray(); } diff --git a/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php b/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php index d3a4ed4406..55f4a330ce 100644 --- a/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php +++ b/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php @@ -590,7 +590,10 @@ class ApiQuerySiteinfoTest extends ApiTestCase { } public function testVariables() { - $this->assertSame( MagicWord::getVariableIDs(), $this->doQuery( 'variables' ) ); + $this->assertSame( + MediaWikiServices::getInstance()->getMagicWordFactory()->getVariableIDs(), + $this->doQuery( 'variables' ) + ); } public function testProtocols() { -- 2.20.1