Creates a namespace manager for a formula processor
@param array $additionalNamespaces An array of namespace arrays (which is an array of namespaces indexed by prefix)
162445
private function addNamespaces( $additionalNamespaces )
	{
		// Load any additional namespaces
		foreach ( $additionalNamespaces as $namespaces )
		{
			if ( is_null( $namespaces ) || ! is_array( $namespaces ) )
			{
				continue;
			}

			foreach ( $namespaces as $prefix => $namespace )
			{
				if ( empty( $prefix ) ) continue;
				$this->nsMgr->addNamespace( $prefix, $namespace );
			}
		}
	}
1174061
public function addNamespace($namespace, $hints)
    {
        /** @var ViewFinderInterface $viewFinder */
        foreach ($this->viewFinders as $viewFinder) {
            try {
                $viewFinder->addNamespace($namespace, $hints);
            } catch (\Exception $e) {
            }
        }
    }
370186
public function setNumSpaces($numSpaces)
    {
        $this->spaces = str_repeat(' ', $numSpaces);
        $this->numSpaces = $numSpaces;

        return $this;
    }
868539
public function registerNamespaces($namespaces, $merge = true)
    {
        foreach ($namespaces as $namespace => $path) {
            $path = rtrim($path, '\\/');
            if (DIRECTORY_SEPARATOR === '\\') {
                $namespaces[$namespace] = strtr($path, '\\', '/');
            }
        }

        $this->_namespaces = $merge ? array_merge($this->_namespaces, $namespaces) : $namespaces;

        return $this;
    }
1223632
public function setNamespaceAliases(array $namespace_aliases)
    {
        $this->namespace_aliases = array();
        foreach ($namespace_aliases as $alias => $fqnn) {
            $this->setNamespaceAlias($alias, $fqnn);
        }
        return $this;
    }
749863
public function register_namespace( $namespace, $paths )
    {
        if ( isset( $this->namespaces[ $namespace ] ) )
        {
            $this->namespaces[ $namespace ] = array_merge(
                $this->namespaces[ $namespace ],
                (array) $paths
            );
        } 
        else 
        {
            $this->namespaces[ $namespace ] = (array) $paths;
            
            // Register PSR_0 as the first autoload filter for every namespace
            $this->register_autoload_filter( $namespace, array( $this, "PSR_0" ) );
        }
    }
19751
public static function createInstance(array $additionalTags = []): self
    {
        $fqsenResolver = new FqsenResolver();
        $tagFactory = new StandardTagFactory($fqsenResolver);
        $descriptionFactory = new DescriptionFactory($tagFactory);

        $tagFactory->addService($descriptionFactory);
        $tagFactory->addService(new TypeResolver($fqsenResolver));

        $docBlockFactory = new self($descriptionFactory, $tagFactory);
        foreach ($additionalTags as $tagName => $tagHandler) {
            $docBlockFactory->registerTagHandler($tagName, $tagHandler);
        }

        return $docBlockFactory;
    }
624625
public function ElementsByNamespaces( $namespaces )
	{
		if ( is_string( $namespaces ) )
			$namespaces = array_map( 'trim', explode( ",", $namespaces ) );

		if ( ! is_array( $namespaces ) )
			throw new Exception( 'InstanceElementsFilter::ElementsByName $namespaces must be a string or array' );

		$namespaces = array_flip( array_map( 'strtolower', $namespaces ) );

		$instance_namespaces = $this->instance->getInstanceNamespaces();

		// In PHP 7.0 $this is passed to closure functions automatically but not in earlier versions
		$elements = &$this->elements;

		$filtered = array_reduce( array_keys( $this->elements ), function( $carry, $elementName ) use( &$elements, $instance_namespaces, $namespaces ) {

			$namespaceElements = array_filter( $elements[ $elementName ], function( $entry ) use( &$elements, $instance_namespaces, $namespaces ) {
				$namespace = isset( $instance_namespaces[ $entry['namespace'] ] ) ? $instance_namespaces[ $entry['namespace'] ] : $entry['namespace'];
				return isset( $namespaces[ strtolower( $namespace ) ] );
			} );

			if ( ! $namespaceElements ) return $carry;

			$carry[ $elementName ] = $namespaceElements;

			return $carry;

		}, array() );

		return new InstanceElementsFilter( $this->instance, $filtered );
	}
986437
public function createNamespace($namespaceName)
    {
        $unquotedNamespaceName = strtolower($this->getUnquotedAssetName($namespaceName));

        if (isset($this->namespaces[$unquotedNamespaceName])) {
            throw SchemaException::namespaceAlreadyExists($unquotedNamespaceName);
        }

        $this->namespaces[$unquotedNamespaceName] = $namespaceName;

        return $this;
    }
118974
protected function getNamespace($config_name, $extra_ns = '')
    {
        $elements =
            [
                $this->prefix_ns,
                Inflector::studlyCaps($config_name),
                Inflector::studlyCaps(sprintf("%s_schema", $this->schema)),
                $extra_ns
            ];

        return join('\\', array_filter($elements, function ($val) { return $val != null; }));
    }
1023148
public function attachNamespace($namespace, $paths)
    {
        if (isset($this->namespaces[$namespace])) {
            if (is_array($paths)) {
                $this->namespaces[$namespace] = array_merge($this->namespaces[$namespace], $paths);
            } else {
                $this->namespaces[$namespace][] = $paths;
            }
        } else {
            $this->namespaces[$namespace] = (array) $paths;
        }

        return $this;
    }
1150812
public function getPrefixForNamespace( $namespace )
	{
		if ( ! isset( $this->processedSchemasByNamespace ) ||
			 count( $this->processedSchemasByNamespace ) != count( $this->processedSchemas )
		)
		{
			$this->processedSchemasByNamespace = array_flip( $this->processedSchemas );
		}

		return isset( $this->processedSchemasByNamespace[ $namespace ] )
			? $this->processedSchemasByNamespace[ $namespace ]
			: false;
	}
166340
static public function setNamespaces($nss)
	{
	    static::initNamespace();
	    
	    $nss = (array) $nss;
	    $rnss = [];
	    foreach ($nss as $ns => $path) {
	        if (!is_numeric($ns)) {
	            $ns = static::formatNamespace($ns);
	            static::loader()->setPsr4($ns, $path);
	        } else {
	            $ns = static::formatNamespace($path);
	        }
	        $rnss[] = $ns;
	    }
	    static::$namespaces = array_merge(static::$namespaces, $rnss);
	    return static::$namespaces = array_unique(static::$namespaces);
	}
1367546
public function addNamespace($namespace, $priority = PriorityQueue::NORMAL)
    {
        $this->controllerResolver->addNamespace($namespace . '\Controller', $priority);
        $this->repositoryResolver->addNamespace($namespace . '\Repository', $priority);
        $this->repositoryResolver->addNamespace($namespace . '\Model', $priority);
        $this->viewResolver->addNamespace($namespace . '\View', $priority);

        return $this;
    }
1022267
protected function _classesInNamespaces($names, array $namespaces, array &$logs = array())
    {
        if (!is_array($names)) {
            $names = array($names);
        }
        foreach ($names as $_name) {
            foreach ($namespaces as $_namespace) {
                if (CodeHelper::namespaceExists($_namespace)) {
                    $tmp_namespace = rtrim(TextHelper::toCamelCase($_namespace), '\\').'\\';
                    if (substr_count(TextHelper::toCamelCase($_name), $tmp_namespace)>0) {
                        return $_name;
                    }
                } else {
                    $logs[] = $this->_getErrorMessage('Namespace "%s" not found!', $_namespace);
                }
            }
        }
        return false;
    }
1117297
def _add_namespaces(self):
        
        self.doc.add_namespace(NIDM)
        self.doc.add_namespace(NIIRI)
        self.doc.add_namespace(CRYPTO)
        self.doc.add_namespace(DCT)
        self.doc.add_namespace(DC)
        self.doc.add_namespace(NFO)
        self.doc.add_namespace(OBO)
        self.doc.add_namespace(SCR)
        self.doc.add_namespace(NIF)
689649
public function addNamespace( $prefix, $namespace )
	{
		if ( empty( $namespace ) )
		{
			throw new ArgumentOutOfRangeException( "The $namespace parameter to addNamespace cannot be null or empty" );
		}

		if ( substr( $prefix, 0, 5 ) == "xmlns" )
		{
			$prefix = substr( $prefix, 5 );
		}

		if ( strlen( $prefix ) > 0 && $prefix[0] == ":" )
		{
			$prefix = substr( $prefix, 1 );
		}

		if ( empty( $prefix) && empty( $this->defaultNamespace ) )
		{
			$this->defaultNamespace = $namespace;
		}

		$this->namespaces[ $prefix ] = $namespace;
	}