getNamespaceInfo()->exists( $ns ) ) { throw new MWException( "Namespace $ns doesn't exist on this wiki" ); } $this->ns = $ns; } /** * Determines which local title best corresponds to the given foreign title. * If such a title can't be found or would be locally invalid, null is * returned. * * @param ForeignTitle $foreignTitle The ForeignTitle to convert * @return Title|null */ public function createTitleFromForeignTitle( ForeignTitle $foreignTitle ) { return Title::makeTitleSafe( $this->ns, $foreignTitle->getText() ); } }