filebackend: use self:: instead of FileBackend:: for some constant uses
[lhc/web/wiklou.git] / includes / TrackingCategories.php
index b3a49c7..d9e185e 100644 (file)
@@ -19,6 +19,8 @@
  * @ingroup Categories
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * This class performs some operations related to tracking categories, such as creating
  * a list of all such categories.
@@ -58,7 +60,7 @@ class TrackingCategories {
 
        /**
         * Read the global and extract title objects from the corresponding messages
-        * @return array Array( 'msg' => Title, 'cats' => Title[] )
+        * @return array [ 'msg' => Title, 'cats' => Title[] ]
         */
        public function getTrackingCategories() {
                $categories = array_merge(
@@ -80,6 +82,7 @@ class TrackingCategories {
                }
 
                $trackingCategories = [];
+               $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
                foreach ( $categories as $catMsg ) {
                        /*
                         * Check if the tracking category varies by namespace
@@ -96,7 +99,7 @@ class TrackingCategories {
                        // Match things like {{NAMESPACE}} and {{NAMESPACENUMBER}}.
                        // False positives are ok, this is just an efficiency shortcut
                        if ( strpos( $msgObj->plain(), '{{' ) !== false ) {
-                               $ns = MWNamespace::getValidNamespaces();
+                               $ns = $nsInfo->getValidNamespaces();
                                foreach ( $ns as $namesp ) {
                                        $tempTitle = Title::makeTitleSafe( $namesp, $catMsg );
                                        if ( !$tempTitle ) {