Return additional XML namespaces.

@return string[] prefix => namespace.

@since 1.0
434836
public function getNamespaces()
    {
        $result = [];
        foreach ($this->registry[NamespaceExtension::class] as $extension) {
            foreach ($extension->getNamespaces() as $prefix => $namespace) {
                $result[$prefix] = $namespace;
            }
        }

        return $result;
    }
867914
private function findChildNamespaces() {
        $currentNamespaceFqsen = (string)$this->currentNamespace->getFqsen();
        /** @var Namespace_ $namespace */
        foreach ($this->namespaces as $namespace) {
            // check if not root and doesn't start with current namespace
            if ($currentNamespaceFqsen !== '\\' && strpos((string)$namespace->getFqsen(), $currentNamespaceFqsen . '\\') !== 0) {
                continue;
            }
            if ((string)$namespace->getFqsen() !== $currentNamespaceFqsen && strpos((string)$namespace->getFqsen(), $currentNamespaceFqsen) === 0) {
                // only keep first level children
                $childrenPath = substr((string)$namespace->getFqsen(), strlen((string)$this->currentNamespace->getFqsen()) + 1);
                if (strpos($childrenPath, '\\') === false) {
                    $this->childNamespaces[] = $namespace;
                }
            }
        }
    }
1238341
function getNamespaceFromPrefix($prefix)
    {
        if (isset($this->namespaces[$prefix])) {
            return $this->namespaces[$prefix];
        }

        //$this->setError("No namespace registered for prefix '$prefix'");
        return FALSE;
    }
653744
function getFormattedNamespaces() {
		$ns = $this->getNamespaces();
		foreach ( $ns as $k => $v ) {
			$ns[$k] = strtr( $v, '_', ' ' );
		}
		return $ns;
	}
1235060
public function getNamespaceForPrefix( $prefix )
	{
		if ( ! isset( $this->instance_namespaces[ $prefix ] ) ) return null;
		return $this->instance_namespaces[ $prefix ];
	}
257707
static public function getNamespaces($type=null)
	{
	    static::initNamespace();
	    
	    if ($type) {
	        $nss = [];
	        foreach (static::$namespaces as $k => $v) {
	            $nss[$k] = $v . ucfirst($type) . '\\';
	        }
	        return $nss;
	    } else {
	        return static::$namespaces;
	    }
	}
1287089
public function getNamespace(): string
    {
        // Check cache.
        if (null === $this->namespace) {
            $tokens = $this->getTokenStream();
            // Find namespace token
            try {
                $loc = $tokens->scan(0, [T_NAMESPACE]);
            } catch (\OutOfBoundsException $e) {
                return $this->namespace = '';
            }

            // Get the next token (start with namespace)
            if ($loc !== null) {
                $loc = $tokens->next($loc);
            }

            // If the start of the namespace is found,
            // parse it, otherwise save empty namespace.
            $this->namespace = '';
            if ($loc !== null) {
                $this->namespace = $this->parseNamespace($loc);
            }
        }

        return $this->namespace;
    }
1114228
public function getNamespaces()
    {
        $db = Database::getActiveConnection();

        /** @var PDOStatement $results */
        $results = $db->createQueryBuilder()
            ->select('configNamespace')
            ->from('Config', 'c')
            ->where('configNamespace != ""')
            ->groupBy('configNamespace')
            ->execute();

        return array_map('array_shift', $results->fetchAll());
    }
685882
public function getNamespace()
    {
        $class       = array();
        $inNamespace = false;

        foreach ($this->tokenlist as $key => $token) {
            if (T_NAMESPACE === $token[0]) {
                $inNamespace = true;
                continue;
            }
            if (T_STRING === $token[0] && $inNamespace) {
                $class[] = $token[1];

            }
            if (';' === $token && $inNamespace) {
                return $class;
            }
        }

        return array();
    }
312549
public function getFileNamespaces()
    {
        if (!isset($this->fileNamespaces)) {
            $this->fileNamespaces = $this->findFileNamespaces();
        }

        return $this->fileNamespaces;
    }
120225
def getNamespace(self, prefix):
        
        namespace = None
        if prefix == 'xmlns':
            namespace = DOM.findDefaultNS(prefix, self.__node)
        else:
            try:
                namespace = DOM.findNamespaceURI(prefix, self.__node)
            except DOMException, ex:
                if prefix != 'xml':
                    raise SchemaError, '%s namespace not declared for %s'\
                        %(prefix, self.__node._get_tagName())
                namespace = XMLNS.XML
        return namespace
1272139
public function detectNamespacesFromXml( $xml )
	{
		$namespaces	= self::getNamespacesFromXml( $xml );
		$this->namespaces	= array_merge( $this->namespaces, $namespaces );
		return count( $namespaces );
	}
296117
public function getNamespaces() {
        $namespaces = [];
        foreach ($this->commands as $command) {
            $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName()));

            foreach ($command->getAliases() as $alias) {
                $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias));
            }
        }

        return array_values(array_unique(array_filter($namespaces)));
    }
816865
public function getRootNamespace()
    {
        if (($psr4 = $this->get('autoload.psr-4')) === null) {
            return null;
        }

        foreach ($psr4 as $namespace => $namespacePaths) {
            foreach ((array)$namespacePaths as $namespacePath) {
                // The namespace path should be a subdirectory of the "src" directory
                if (mb_strpos(realpath($this->rootPath . '/' . $namespacePath), realpath($this->psr4RootPath)) === 0) {
                    return rtrim($namespace, '\\');
                }
            }
        }

        return null;
    }
18673
protected function findDeclaredFusionNamespaces()
    {
        $namespaces = [];

        $targetDirectory = $this->targetPackageData['path'] . '/Resources/Private';
        if(!is_dir($targetDirectory)) {
            return $namespaces;
        }

        foreach (Files::getRecursiveDirectoryGenerator($targetDirectory, null, true) as $pathAndFilename) {
            $pathInfo = pathinfo($pathAndFilename);
            if (!isset($pathInfo['filename'])) {
                continue;
            }
            if (strpos($pathAndFilename, 'Migrations/Code') !== false) {
                continue;
            }

            if (array_key_exists('extension', $pathInfo) && ($pathInfo['extension'] == 'ts2' || $pathInfo['extension'] == 'fusion')) {
                $namespaceDeclarationMatches = [];
                $count = preg_match_all(
                    '/^namespace:[\\s]*(?P<alias>[\\w\\.]+)[\\s]*\\=[\\s]*(?P<packageKey>[\\w\\.]+)[\\s]*$/um',
                    file_get_contents($pathAndFilename),
                    $namespaceDeclarationMatches,
                    PREG_SET_ORDER
                );
                if ($count > 0) {
                    foreach ($namespaceDeclarationMatches as $match) {
                        if (!array_key_exists($match['alias'], $namespaces)) {
                            $namespaces[$match['alias']] = $match['packageKey'];
                        } else {
                            if ($namespaces[$match['alias']] !== $match['packageKey']) {
                                $this->showWarning(
                                    sprintf(
                                        'Namespace-alias "%s" was declared multiple times for different aliases %s is used',
                                        $match['alias'],
                                        $namespaces[$match['alias']]
                                    )
                                );
                            }
                        }
                    }
                }
            }
        }
        return $namespaces;
    }
1350871
public Set<Namespace> getAllNamespaces() {
        if (namespaceGroup == null) {
            return emptySet();
        }
        return new HashSet<Namespace>(namespaceGroup.getAllNamespaces());
    }
475116
private function namespaceName() {
    $node = new NameNode();
    $this->mustMatch(T_STRING, $node, NULL, TRUE);
    while ($this->tryMatch(T_NS_SEPARATOR, $node)) {
      $this->mustMatch(T_STRING, $node, NULL, TRUE);
    }
    return $node;
  }