@param string $namespace

@return bool
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;
    }
900851
protected function validateNamespace($namespace)
    {
        switch ($namespace) {
            case 'ns:DNS':
                return Uuid::NAMESPACE_DNS;
                break;
            case 'ns:URL':
                return Uuid::NAMESPACE_URL;
                break;
            case 'ns:OID':
                return Uuid::NAMESPACE_OID;
                break;
            case 'ns:X500':
                return Uuid::NAMESPACE_X500;
                break;
        }

        if (Uuid::isValid($namespace)) {
            return $namespace;
        }

        throw new Exception(
            'Invalid namespace. '
            . 'May be either a UUID in string representation or an identifier '
            . 'for internally pre-defined namespace UUIDs (currently known '
            . 'are "ns:DNS", "ns:URL", "ns:OID", and "ns:X500").'
        );
    }
72771
public function hasNodeRef(NodeRef $nodeRef, string $namespace = self::DEFAULT_NAMESPACE): bool
    {
        if (!isset($this->nodeRefs[$namespace])) {
            return false;
        }

        return isset($nodeRefs[$namespace][$nodeRef->toString()]);
    }
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;
    }
503096
public function delete($key, $namespace)
    {
        // Get internal key
        $key = $this->calculateUuid($key);

        // Assume the process will fail
        $result = true;

        // First of all - remove element from namespace ...
        $this->purgeRuntimeCache($key, $namespace);

        // Get file
        $filename = $this->getFilenameByKeyAndNamespace($key, $namespace);

        // Check if file exists
        if (file_exists($filename) === true) {
            $result = unlink($filename);

            // clear php's file cache
            $this->clear();
        }

        // return the result
        return $result;
    }
509790
public static function classExists($className, $namespace)
    {
        if (class_exists($className)) {
            return $className;
        }

        // add namespace
        $className = sprintf('%s%s', static::getFormatNamespace($namespace, true), $className);

        if (class_exists($className)) {
            return $className;
        }

        return false;
    }
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;
    }
844469
def has_namespace(self, namespace: str) -> bool:
        """"""
        return self.has_enumerated_namespace(namespace) or self.has_regex_namespace(namespace)
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;
    }
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;
    }
375273
public function setNamespace($namespace)
    {
        $namespace = rtrim(trim($namespace), '\\');

        if ($namespace === $this->namespace) {
            return;
        }

        $this->namespace = $namespace;
        if ($namespace && (!$this->package || $this->packageOverridden) && $this->getBuildProperty('generator.namespaceAutoPackage')) {
            $this->package = str_replace('\\', '.', $namespace);
            $this->packageOverridden = true;
        }
    }
785104
public function setNamespaceRoot($namespaceRoot = '\\')
    {
        $namespaceRoot = trim($namespaceRoot, '/\\');
        if (empty($namespaceRoot)) {
            $this->namespaceRoot = '\\';
            return true;
        }
        $this->namespaceRoot = sprintf('\\%s\\', $namespaceRoot);
        return true;
    }
710255
public function getPermission( $namespace )
	{
		$node = Arr::get( $this->cachedPermissions, $namespace . '.__node' );
		if ( !$node )
		{
			$node = new Permission( $this, basename( str_replace( ".", "/", $namespace ) ) );
			Arr::set( $this->cachedPermissions, $namespace . '.__node', $node );
		}

		return $node;
	}
702903
public function exists($name, $namespace = 'default')
    {
        if ($this->state !== static::STATE_ACTIVE && $this->state !== static::STATE_EXPIRED) {
            if ($this->debug) {
                throw new \RuntimeException('Session is not active.');
            }

            return false;
        }

        return $this->getBag($namespace)->has($name);
    }
666873
final public function isLocked($namespace)
    {

        if (empty($namespace)) {

            return true; //just say its locked
        }
        //checks if a namespace in this session is locked
        $session = $this;
        //unlocks a namespace
        if (isset($session->registry[$namespace])) {
            return $session->registry[$namespace]->isLocked();
        }

        return false;
    }
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;
    }
976362
public function addNamespace($name)
    {
        if (!Arr::in($name, self::$_namespace)) {
            self::$_namespace[] = $name;
            return true;
        }

        return false;
    }