@param $namespace

@return bool|string
172809
private function getNamespaceDirectory($namespace)
    {
        $composerNamespaces = $this->getDefinedNamespaces();

        $namespaceFragments = explode('\\', $namespace);
        $undefinedNamespaceFragments = [];

        while ($namespaceFragments) {
            $possibleNamespace = implode('\\', $namespaceFragments) . '\\';

            if (array_key_exists($possibleNamespace, $composerNamespaces)) {
                $path = app()->basePath() . DIRECTORY_SEPARATOR . $composerNamespaces[$possibleNamespace] . implode('/', array_reverse($undefinedNamespaceFragments));

                return realpath($path);
            }

            $undefinedNamespaceFragments[] = array_pop($namespaceFragments);
        }

        return false;
    }
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);
    }
485503
public function hasClassExtension(string $namespace): bool
    {
        $hasClassExtension = false;

        if ($this->hasSetting(ModuleSetting::CLASS_EXTENSIONS)) {
            $classExtensions = $this
                ->getSetting(ModuleSetting::CLASS_EXTENSIONS)
                ->getValue();

            $hasClassExtension = in_array($namespace, $classExtensions, true);
        }

        return $hasClassExtension;
    }
1325847
public function getPrefixForNamespace( $namespace )
	{
		if (
			  ! isset( $this->cacheNamespaces ) ||
			  count( $this->cacheNamespaces ) != count( $this->instance_namespaces )
		   )
		{
			$this->cacheNamespaces = array_flip( $this->instance_namespaces );
			// If the default namespace is one of the standards ones then the prefix may be missing
			$standardNamespaces = array_flip( XBRL_Constants::$standardPrefixes );
			if ( isset( $this->instance_namespaces[''] ) )
			{
				if ( isset( $standardNamespaces[ $this->instance_namespaces[''] ] ) )
				{
					$this->cacheNamespaces[ $this->instance_namespaces[''] ] = $standardNamespaces[ $this->instance_namespaces[''] ];
				}
			}
		}

		return isset( $this->cacheNamespaces[ $namespace ] )
			? $this->cacheNamespaces[ $namespace ]
			: false;
	}
129573
public function getPath (string $namespace) : string
    {
        if (!isset($this->namespaces[$namespace]))
        {
            throw new AssetsException(sprintf(
                "Unknown entry namespace: '%s'",
                $namespace
            ));
        }

        return $this->namespaces[$namespace];
    }
474546
public function getNamespace($namespace)
    {
        $classes = [];
        $definitions = $this->classes->extract();

        foreach (array_keys($definitions) as $class) {
            if (strpos($class, $namespace, 0) === 0) {
                $classes[$class] = $this->get($class);
            }
        }

        return $classes;
    }
59076
public function render($namespace = null)
    {
        $messagesToPrint = '';

        // get messages from each namespace.
        if (null === $namespace) {
            foreach ($this->classMessages as $namespace => $class) {
                $messagesToPrint .= $this->fetchMessagesFromNamespace($namespace);
            }
        } else {
            $messagesToPrint .= $this->fetchMessagesFromNamespace($namespace);
        }

        return $messagesToPrint;
    }
1000400
public function getNextComponent( $namespace) {
        $namespaceComponents = explode( '\\', $namespace);
        $class_x = explode( '\\', $this->class);

        while( array_shift( $namespaceComponents)){
            array_shift( $class_x);
        }

        return array_shift( $class_x);
    }
1020670
protected function getPath(?string $namespace): ?string
    {
        if (\is_null($namespace)) {
            return $this->defaultPath;
        } elseif (isset($this->hints[$namespace])) {
            return $this->hints[$namespace];
        }

        return null;
    }
774839
public function getModuleNameByNamespace($namespace = null)
    {
        $defaultNamespace = 'app';
        $currentRoute = app('router')->getCurrentRoute();

        if (is_null($namespace) and !is_null($currentRoute)) {
            $namespace = $currentRoute->getAction()['namespace'];
        }

        if (is_null($namespace)) {
            return $defaultNamespace;
        }

        foreach ($this->moduleLoader->getRegisteredModules() as $module) {
            if (!empty($moduleNamespace = $module->getNamespace())) {
                if (strpos($namespace, $moduleNamespace) === 0) {
                    return $module->getKey();
                }
            }
        }

        return $defaultNamespace;
    }
1077097
public static function v3($namespace, $name)
    {
        if (!Validate::isValidUUID($namespace)) {
            return false;
        }

        // Get hexadecimal components of namespace
        $nhex = str_replace(array('-', '{', '}'), '', $namespace);

        // Binary Value
        $nstr = '';

        // Convert Namespace UUID to bits
        for ($i = 0; $i < strlen($nhex); $i += 2) {
            $nstr .= \chr(hexdec($nhex[$i] . $nhex[$i + 1]));
        }

        // Calculate hash value
        $hash = md5($nstr . $name);

        return sprintf('%08s-%04s-%04x-%04x-%12s',

            // 32 bits for "time_low"
            substr($hash, 0, 8),

            // 16 bits for "time_mid"
            substr($hash, 8, 4),

            // 16 bits for "time_hi_and_version",
            // four most significant bits holds version number 3
            (hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x3000,

            // 16 bits, 8 bits for "clk_seq_hi_res",
            // 8 bits for "clk_seq_low",
            // two most significant bits holds zero and one for variant DCE1.1
            (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,

            // 48 bits for "node"
            substr($hash, 20, 12)
        );
    }
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;
	}
90470
public function getNamespace($ns) {
    $namespaces = $this
      ->getNamespaces()
      ->filter(function(NamespaceNode $node) use ($ns) {
        return $node->getName()->getPath() === $ns;
      });

    return $namespaces->isEmpty() ? NULL : $namespaces[0];
  }
1161770
private function getParameters($namespace)
    {
        $parameters = [];

        /** @var Parameter $parameter */
        foreach ($this->parameterRepository->findBy(['namespace' => $namespace]) as $parameter) {
            $parameters[$parameter->getName()] = $parameter->getValue();
        }

        return $parameters;
    }
421139
public function inNamespace($ns) {
    if (is_string($ns)) {
      $namespace_node = $this->name->getNamespace();
      $namespace = $namespace_node === NULL ? '' : $namespace_node->getName()->getAbsolutePath();
      return $ns === $namespace;
    }
    elseif ($ns instanceof NamespaceNode) {
      return $this->name->getNamespace() === $ns;
    }
    else {
      throw new \InvalidArgumentException();
    }
  }
563459
private function normalizeNamespace($namespace)
    {
        $namespace = str_replace('\\\\', '\\', $namespace);
        $namespace = explode('\\', $namespace);

        array_walk($namespace, function (&$item) { $item = ucfirst($item); });

        return trim(implode('\\', $namespace), '\\');
    }
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;
    }