/**
* Method to get a namespace object for a given namespace prefix.
*
* @param string $prefix The XML prefix for which to fetch the namespace object.
*
* @return mixed NamespaceParserInterface or false if none exists.
*
* @since 3.1.4
*/
protected function fetchNamespace($prefix)
{
if (isset($this->namespaces[$prefix])) {
return $this->namespaces[$prefix];
}
$className = \get_class($this) . ucfirst($prefix);
if (class_exists($className)) {
$this->namespaces[$prefix] = new $className();
return $this->namespaces[$prefix];
}
return false;
}