28 private $contentLanguage;
34 $this->contentLanguage = $contentLanguage;
56 $pieces = explode(
':',
$title, 2 );
70 $isNamespacePartValid = $ns ===
null
71 ? $this->contentLanguage->getNsIndex( $pieces[0] ) !== false
74 if ( count( $pieces ) === 2 && $isNamespacePartValid ) {
75 [ $namespaceName, $pageName ] = $pieces;
81 return new ForeignTitle( $ns, $namespaceName, $pageName );
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
Base class for language-specific code.
A parser that translates page titles on a foreign wiki into ForeignTitle objects, with no knowledge o...
createForeignTitle( $title, $ns=null)
Create a ForeignTitle object.
__construct(Language $contentLanguage)
A parser that translates page titles into ForeignTitle objects.