* @ingroup Categories
*/
+use MediaWiki\MediaWikiServices;
+
/**
* This class performs some operations related to tracking categories, such as creating
* a list of all such categories.
/**
* 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(
}
$trackingCategories = [];
+ $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
foreach ( $categories as $catMsg ) {
/*
* Check if the tracking category varies by namespace
// 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 ) {