Hard-deprecate MagicWord static methods
authorAryeh Gregor <ayg@aryeh.name>
Mon, 30 Jul 2018 14:57:53 +0000 (17:57 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Tue, 9 Apr 2019 08:51:36 +0000 (11:51 +0300)
Bug: T200247
Change-Id: Ib36e78274f42ddbeaa7801cc8bad77b991a4a1aa

includes/MagicWord.php
tests/phpunit/includes/api/ApiQuerySiteinfoTest.php

index 4420d1d..3c77234 100644 (file)
@@ -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();
        }
 
index d3a4ed4..55f4a33 100644 (file)
@@ -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() {