Get the taxonomy for the $namespace
@param string $namespace The namespace of the taxonomy to retrieve
@return XBRL An XBRL instance or false
503685
public function getTaxonomyForNamespace( $namespace )
	{
		if ( ! isset( $this->context->importedSchemas[ $namespace ] ) )
		{
			if ( XBRL::endsWith( $namespace, '/' ) )
			{
				$namespace = substr( $namespace, 0, strlen( $namespace ) - 1 );
			}
			else if ( ! XBRL::endsWith( $namespace, '/' ) )

			{
				$namespace .= '/';
			}
			if ( ! isset( $this->context->importedSchemas[ $namespace ] ) )
			{
				return false;
			}
		}

		return $this->context->importedSchemas[ $namespace ];
	}
917747
private static function classBelongsToNamespace($className, $namespaces)
    {
        $belongsToNamespace = false;
        $check = array_values($namespaces);
        $lcClassName = strtolower(ltrim($className, '\\'));

        foreach ($check as $namespace) {
            if (false !== strpos($lcClassName, strtolower($namespace))) {
                $belongsToNamespace = true;
                continue;
            }
        }
        return $belongsToNamespace;
    }
1249219
public function getIdentifier($namespace)
    {
        $namespace = Str::normalizeClassName($namespace);
        if (strpos($namespace, '\\') === null) {
            return $namespace;
        }

        $parts = explode('\\', $namespace);
        $slice = array_slice($parts, 1, 2);
        $namespace = implode('.', $slice);

        return $namespace;
    }
722336
public static function get(string $namespace, string $name = null)
    {
        $name = $name ?: 'default';

        if (isset(self::$container[$namespace][$name])) {
            return self::$container[$namespace][$name];
        }

        return null;
    }
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;
    }
43564
protected function getNamespacesFromClass($namespace)
    {
        $classStack = [$namespace];
        $classStack = array_merge($classStack, class_parents($namespace));
        $classStack = array_merge($classStack, class_implements($namespace));

        return $classStack;
    }
252826
public function getNamespace()
    {
        if (!isset($this->namespace)) {
            $reflectionClass = new \ReflectionClass($this->name);
            $this->namespace = $reflectionClass->getNamespaceName();
        }
        return $this->namespace;
    }
711971
protected function searchModulePath($namespace)
    {
        $targetPath = false;
        
        // Iterate trough the module directories
        foreach ($this->moduleDirectories as $directory => $excludePattern) {
            $recursiveDirectoryIterator = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS);
            $iterator = new \RecursiveIteratorIterator($recursiveDirectoryIterator);
            $regexIterator = new \RegexIterator($iterator, '/^.+\/Module\.json$/i');

            foreach ($regexIterator as $item) {
                // Ignore modules which are located inside a tests directory
                if ($excludePattern !== false && preg_match($excludePattern, $item->getPath())) {
                    continue;
                }
                
                $moduleNamespace = $this->getNamespaceFromModuleJson($item->getPath());
                
                if ($moduleNamespace === $namespace) {
                    $targetPath = $item->getPath();
                    break 2;
                }
            }
        }
        
        return $targetPath;
    }
423172
public function evaluateEntityNamespace(string $namespace)
    {
        /**
         * Trying to generate new entity given that the class is the entity
         * namespace.
         */
        if (class_exists($namespace)) {
            return $namespace;
        }

        /**
         * Trying to generate new entity given that the namespace is defined in
         * as a Container parameter.
         */
        $container = $this->container;
        if (
            $container->hasParameter($namespace) &&
            class_exists($container->getParameter($namespace))
        ) {
            $namespaceParameter = $container->getParameter($namespace);

            return $namespaceParameter;
        }

        $resolvedNamespace = explode(':', $namespace, 2);
        $bundles = $this->kernel->getBundles();

        /**
         * Trying to get entity using Doctrine short format.
         *
         * MyBundle:MyEntity
         *
         * To accept this format, entities must be at Entity/ folder in the
         * bundle root dir
         *
         * /MyBundle/Entity/MyEntity
         *
         * If entity definition is wrong, throw exception
         * If bundle not exists or is not actived, throw Exception
         */
        if (
        !(
            isset($resolvedNamespace[0]) &&
            isset($bundles[$resolvedNamespace[0]]) &&
            $bundles[$resolvedNamespace[0]] instanceof Bundle &&
            isset($resolvedNamespace[1])
        )
        ) {
            throw new ClassNotFoundException(
                $namespace,
                new ErrorException()
            );
        }

        /**
         * @var Bundle $bundle
         */
        $bundle = $bundles[$resolvedNamespace[0]];
        $bundleNamespace = $bundle->getNamespace();
        $namespace = $bundleNamespace . '\\Entity\\' . $resolvedNamespace[1];

        if (!class_exists($namespace)) {
            throw new ClassNotFoundException(
                $namespace,
                new ErrorException()
            );
        }

        /**
         * Otherwise, assume that class is namespace of class.
         */

        return $namespace;
    }
229386
protected function findExtensions($namespace)
    {
        $this->initializeNamespaces();
        $files = [];
        $old = [];
        $namespaces = [$namespace, 'Staq\Core\Ground'];
        while (array_diff($namespaces, $old)) {
            $extensions = $this->formatExtensionsFromNamespaces($namespaces);
            foreach ($extensions as $extension) {
                $files[] = $extension . '/setting/Application.ini';
            }
            $ini = (new \Pixel418\Iniliq\IniParser)->parse(array_reverse($files));
            $old = $namespaces;
            $namespaces = array_reverse($ini->getAsArray('extension.list'));
            $namespaces = \UArray::reverseMergeUnique($old, $namespaces);
        }
        return $this->formatExtensionsFromNamespaces($namespaces);
    }
599900
public function getClassesFromNamespace($namespace = null)
    {
        $namespace = $namespace ?: $this->getAppNamespace();

        $path = $this->convertNamespaceToPath($namespace);

        return $this->finder->findClasses($path);
    }
841536
protected static function & _namespaceGet($namespace, $name = null)
    {
        if (self::$_readable === false) {
            /**
             * @see Zend_Session_Exception
             */
            require_once 'Zend/Session/Exception.php';
            throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
        }

        if ($name === null) {
            if (isset($_SESSION[$namespace])) { // check session first for data requested
                return $_SESSION[$namespace];
            } elseif (isset(self::$_expiringData[$namespace])) { // check expiring data for data reqeusted
                return self::$_expiringData[$namespace];
            } else {
                return $_SESSION[$namespace]; // satisfy return by reference
            }
        } else {
            if (isset($_SESSION[$namespace][$name])) { // check session first
                return $_SESSION[$namespace][$name];
            } elseif (isset(self::$_expiringData[$namespace][$name])) { // check expiring data
                return self::$_expiringData[$namespace][$name];
            } else {
                return $_SESSION[$namespace][$name]; // satisfy return by reference
            }
        }
    }
531787
public function getData($namespace = null)
    {
        if(!self::$pluginData) {
            // try to find the model via namespace
            if (!$namespace) {
                // if we are in a model
                if (property_exists($this, 'namespace')) {
                    self::$pluginData = $this;
                } /// When calling the method from a parent class that uses this class as a parent
                else {
                    // try to find plugin's model via reflection class
                    try{
                        $reflector = new \ReflectionClass(self::class);
                        $fn = $reflector->getFileName();
                        $explode = explode('plugins/', str_replace('\\', '/', dirname($fn)));
                        if (isset($explode[1])) {
                            $pluginNamespace = str_replace('/Controllers', '', $explode[1]);
                            self::$pluginData = Plugin::where('namespace', $pluginNamespace)->first();
                        }

                    }catch(\Exception $e){
                        return null;
                    }
                }
            }else {
                // Return a requested plugin
                self::$pluginData = $this->getByNamespace($namespace);
            }
        }

        if (!self::$pluginData) {
            return null;
        }

        return self::$pluginData;
    }
466818
protected function needAliasForClassName($class, $namespace)
    {
        if ($namespace == $this->getNamespace()) {
            return false;
        }

        if (str_replace('\\Base', '', $namespace) == str_replace('\\Base', '', $this->getNamespace())) {
            return true;
        }

        if (empty($namespace) && 'Base' === $this->getNamespace()) {
            if (str_replace(['Query'], '', $class) == str_replace(['Query'], '', $this->getUnqualifiedClassName())) {
                return true;
            }

            if ((false !== strpos($class, 'Query'))) {
                return true;
            }

            // force alias for model without namespace
            if (false === array_search($class, $this->whiteListOfDeclaredClasses, true)) {
                return true;
            }
        }

        if ('Base' === $namespace && '' === $this->getNamespace()) {
            // force alias for model without namespace
            if (false === array_search($class, $this->whiteListOfDeclaredClasses, true)) {
                return true;
            }
        }

        return false;
    }
360499
public function setNamespace($namespace)
	{
	    $this->namespace = rtrim($namespace, '\\');
	    
	    // set autoload
	    if ($this->namespace) {
	        Ioc::loader()->setPsr4($this->namespace, $this->basePath . 'src');
	    }
	    
	    return $this;
	}
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;
    }
1154700
public function findNamespace(string $namespace): string
	{
		$allNamespaces = $this->getNamespaces();

		$expr = preg_replace_callback(
			'{([^:]+|)}',
			function ($matches)
			{
				return preg_quote($matches[1]) . '[^:]*';
			},
			$namespace
		);

		$namespaces = preg_grep('{^' . $expr . '}', $allNamespaces);

		if (empty($namespaces))
		{
			throw new NamespaceNotFoundException(sprintf('There are no commands defined in the "%s" namespace.', $namespace));
		}

		$exact = \in_array($namespace, $namespaces, true);

		if (\count($namespaces) > 1 && !$exact)
		{
			throw new NamespaceNotFoundException(sprintf('The namespace "%s" is ambiguous.', $namespace));
		}

		return $exact ? $namespace : reset($namespaces);
	}