use LinkCache;
use Linker;
use MediaWiki\MediaWikiServices;
-use MWNamespace;
+use NamespaceInfo;
use Sanitizer;
use Title;
use TitleFormatter;
*/
private $linkCache;
+ /**
+ * @var NamespaceInfo
+ */
+ private $nsInfo;
+
/**
* Whether to run the legacy Linker hooks
*
/**
* @param TitleFormatter $titleFormatter
* @param LinkCache $linkCache
+ * @param NamespaceInfo $nsInfo
*/
- public function __construct( TitleFormatter $titleFormatter, LinkCache $linkCache ) {
+ public function __construct(
+ TitleFormatter $titleFormatter, LinkCache $linkCache, NamespaceInfo $nsInfo
+ ) {
$this->titleFormatter = $titleFormatter;
$this->linkCache = $linkCache;
+ $this->nsInfo = $nsInfo;
}
/**
if ( $this->linkCache->getGoodLinkFieldObj( $target, 'redirect' ) ) {
# Page is a redirect
return 'mw-redirect';
- } elseif ( $this->stubThreshold > 0 && MWNamespace::isContent( $target->getNamespace() )
- && $this->linkCache->getGoodLinkFieldObj( $target, 'length' ) < $this->stubThreshold
+ } elseif (
+ $this->stubThreshold > 0 && $this->nsInfo->isContent( $target->getNamespace() ) &&
+ $this->linkCache->getGoodLinkFieldObj( $target, 'length' ) < $this->stubThreshold
) {
# Page is a stub
return 'stub';