Returns the instance with specified namespace.

@param string $namespace The namespace

@return self The new instance with specified namespace
960430
public function withNameSpace($namespace)
    {
        $namespace = (string) $namespace;

        if (! isset(static::$namespaces[$namespace])) {
            $new = clone $this;
            $new->setNamespace($namespace);
            $new->setEnabled($this->enabled);
            static::$namespaces[$namespace] = $new;
        }

        return static::$namespaces[$namespace];
    }
760545
public static function setNamespaces($namespaces)
    {
        $called = get_called_class();

        if (!$namespaces instanceof PriorityQueue) {
            $namespaces = new PriorityQueue();
        }

        static::$namespaces[$called] = $namespaces;
    }
1249645
public function setNamespace($namespace)
    {
        if ($namespace === null || $namespace === '' || $namespace === '\\') {
            $this->namespace = null;

            return;
        }

        if ($namespace[0] === '\\') {
            $namespace = substr($namespace, 1);
        }

        if ($this->isNamespaceValid($namespace) !== true) {
            throw new InvalidArgumentException('Namespace name is not valid.');
        }

        $this->namespace = $namespace;
    }
678384
public function setNamespaces(array $namespaces)
    {
        $this->namespaces = array();

        foreach ($namespaces as $prefix => $uri) {
            $this->addNamespace($uri, $prefix);
        }

        return $this;
    }
233538
protected function checkOverrider($namespace)
    {
        if ($this->allowOverride && isset($this->overrides[$namespace])) {
            $oldNamespace = $namespace;

            $namespace = $this->overrides[$namespace]['overrider'];
            $this->classExists($namespace);

            if ($this->overrides[$oldNamespace]['only_once']) {
                $this->unsetOverrider($oldNamespace);
            }
        }

        return $namespace;
    }
286914
public function makeInstance(string $namespace, $arguments = [])
    {
        if (!class_exists($namespace)) {
            throw new ContainerException(sprintf('Class "%s" not exists.', $namespace));
        }
        $class = $this->getClassNameFromNamespace($namespace);

        if ($this->has($class)) {
            return $this->get($class);
        }

        return $this[$class] = new $namespace($arguments);
    }
10552
public function add($data, $namespace='default')
    {
        Type::force($data, ArrayAccess::class);

        if (!isset($this->addedData[$namespace])) {
            $this->addedData[$namespace] = [];
        }

        $this->addedData[$namespace][] = $data;

        return $this;
    }
214711
public function getMapping($namespace)
    {
        $cacheName = 'ongr.metadata.document.'.md5($namespace);

        $namespace = $this->getClassName($namespace);
        $this->enableCache && $mapping = $this->cache->fetch($cacheName);

        if (isset($mapping) && false !== $mapping) {
            return $mapping;
        }

        $mapping = $this->getDocumentReflectionMapping(new \ReflectionClass($namespace));

        $this->enableCache && $this->cache->save($cacheName, $mapping);

        return $mapping;
    }
473255
public function setNamespace($namespace)
    {
        if (is_string($namespace) === false) {
            $msg = "The namespace argument must be a string.";
            throw new InvalidArgumentException($msg);
        } elseif ($namespace === '') {
            $msg = "The namespace argument must be a non-empty string.";
            throw new InvalidArgumentException($msg);
        } else {
            $this->namespace = $namespace;
        }
    }
275850
public function lookupCacheStore(string $namespace): CacheStore {
		$dirFsPath = $this->dirFsPath->ext(VarStore::namespaceToDirName($namespace));
		if (!$dirFsPath->isDir()) {
			$dirFsPath->mkdirs($this->dirPerm);
		}
		
		return new FileCacheStore($dirFsPath, $this->dirPerm, $this->filePerm);
	}
1000441
public function registerNamespace($namespace, $paths)
    {
        if (false === isset($this->_namespaces[$namespace])) {
            $this->_namespaces[$namespace] = array();
        }

        $this->_namespaces[$namespace] = array_merge($this->_namespaces[$namespace], (array) $paths);

        return $this;
    }
1233922
public static function SetNamespace($sNamespace){
            $oThis = self::CreateInstanceIfNotExists();

            if(is_string($sNamespace)){
                $sNamespace = strtolower(str_replace(" ", "_", $sNamespace));
                $oThis->sNamespace = $sNamespace;
            }
        }
585807
public function setNamespaces($namespaces)
    {
        if (!$namespaces instanceof PriorityQueue) {
            $namespaces = new PriorityQueue($namespaces);
        }

        $this->namespaces = $namespaces;

        return $this;
    }
902406
protected static function _namespaceGetAll($namespace)
    {
        $currentData  = (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) ?
            $_SESSION[$namespace] : array();
        $expiringData = (isset(self::$_expiringData[$namespace]) && is_array(self::$_expiringData[$namespace])) ?
            self::$_expiringData[$namespace] : array();
        return array_merge($currentData, $expiringData);
    }
1024210
public function getClassesInNamespace(string $namespace)
    {
        $arrOptions = [];

        foreach (get_declared_classes() as $strName) {
            if ($this->container->get('huh.utils.string')->startsWith($strName, $namespace)) {
                $arrOptions[$strName] = $strName;
            }
        }

        asort($arrOptions);

        return $arrOptions;
    }
91979
public function make(string $namespace, array $arguments = [])
    {
        $class = $this->getClassNameFromNamespace($namespace);
        /*
         * If instance of the class already created and stored into
         * stack then simply return from here
         */
        if ($this->has($class)) {
            return $this->get($class);
        }
        $reflectionClass = $this->reflection->setClass($namespace)->getReflectionClass();
        $this->throwExceptionIfNotInstantiable($namespace, $reflectionClass);

        $constructor = null;
        $constructorArgsCount = 0;
        list($constructor, $constructorArgsCount) = $this->getConstructorArgs($reflectionClass, $constructorArgsCount);

        // if class does not have explicitly defined constructor or constructor
        // does not have parameters get the new instance
        if (!isset($constructor) && is_null($constructor) || $constructorArgsCount < 1) {
            return $this[$class] = $reflectionClass->newInstance();
        }

        $dependencies = $constructor->getParameters();
        $constructorArgs = $this->createMethodArgument($dependencies, $arguments);

        return $this[$class] = $reflectionClass->newInstanceArgs($constructorArgs);
    }
560641
public function all($namespace = null)
    {
        $this->init();

        if (null === $namespace) {
            if (!$this->commandLoader) {
                return $this->commands;
            }

            $commands = $this->commands;
            foreach ($this->commandLoader->getNames() as $name) {
                if (!isset($commands[$name]) && $this->has($name)) {
                    $commands[$name] = $this->get($name);
                }
            }

            return $commands;
        }

        $commands = [];
        foreach ($this->commands as $name => $command) {
            if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) {
                $commands[$name] = $command;
            }
        }

        if ($this->commandLoader) {
            foreach ($this->commandLoader->getNames() as $name) {
                if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) {
                    $commands[$name] = $this->get($name);
                }
            }
        }

        return $commands;
    }