exists( $ns ) ) { throw new InvalidArgumentException( "Namespace $ns doesn't exist on this wiki" ); } $this->titleFactory = $titleFactory; $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 $this->titleFactory->makeTitleSafe( $this->ns, $foreignTitle->getText() ); } } /** @deprecated class alias since 1.41 */ class_alias( NamespaceImportTitleFactory::class, 'NamespaceImportTitleFactory' );