Get root namespace for this package.

@return array|null|string
177745
protected function getRootNameSpace()
    {
        if (!$namespace = $this->option('namespace')) {
            list($vendor, $name) = explode('/', $this->package);

            $default = str_replace(['-', '-'], '', Str::title($vendor).'\\'.Str::title($name));

            $namespace = $this->ask('Root namespace', $default);
        }

        return $namespace;
    }
967646
protected function getNamespace($namespace = null)
    {
        if (!is_null($namespace)) {
            $parts = explode('\\', $namespace);

            array_pop($parts);

            return join('\\', $parts);
        }

        return $this->getAppNamespace() . $this->namespace;
    }
683969
public function getRootDir()
    {
        if (null === $this->rootDir) {
            $this->rootDir = realpath(getcwd() . '/app');
        }

        return $this->rootDir;
    }
611519
protected function getDefaultNamespace($rootNamespace)
    {
        $serviceRootNamespace = Config::get('service-classes.namespace');

        if (! $serviceRootNamespace) {
            throw InvalidNamespaceException::missingServiceNamespace();
        }

        return $rootNamespace.'\\'.$serviceRootNamespace;
    }
700052
public function getPropertyName() {
    $root_property = $this->getRootProperty();
    if ($root_property instanceof TokenNode && $root_property->getType() === T_STRING) {
      return $root_property->getText();
    }
    return NULL;
  }
855740
public function getDocumentNamespaces()
	{
		if ( ! $this->documentPrefixes )
		{
			if ( ! property_exists( $this, 'xbrlDocument' ) ) return null;
			$this->documentPrefixes = $this->xbrlDocument->getDocNamespaces( true );
		}

		return $this->documentPrefixes;
	}
964218
public function getNamespace(): string
    {
        return ($this->getBundleNamespace() ? $this->getBundleNamespace() : static::NO_BUNDLE_NAMESPACE) . '\\Entity'.
            ($this->getSubDir() ? '\\'. $this->getSubDir() : '')
        ;
    }
1264676
public function getRoot()
    {
        if ($this->getSection()->getRoot() instanceof Section) {
            return $this->getSection()->getRoot()->getPage();
        }

        return null;
    }
497165
public function configureNamespace()
    {
        $this->namespace = (!blank($this->config->get('tie.rootNamespace')) ? $this->config->get('tie.rootNamespace') : studly_case($this->vendor)) . '\\' . studly_case($this->package) . '\\';
    }
546765
public static function getNamespace($classPath)
    {
        $src = file_get_contents($classPath);

        if (preg_match('/namespace\s+(.+?);/', $src, $m)) {
            return $m[1];
        }

        return null;
    }
1044844
public function getRootPath()
    {
        if (null === $this->rootPath) {
            $this->rootPath = dirname((new \ReflectionClass($this))->getFileName());
        }

        return $this->rootPath;
    }
146677
private function getNamespacedPackageName()
    {
        $path = $this->getTemplateArgumentPath();
        $templateName = json_decode(file_get_contents($path . 'composer.json'))->name;
        $parts = explode('/', $templateName);
        return package_vendor_namespace($parts[0], $parts[1]) . '\Package';
    }
648537
public function getBundleName(): ?string
    {
        if ($this->getBundleNamespace() === static::NO_BUNDLE_NAMESPACE) {
            return null;
        }
        if (strpos('\\', $this->getBundleNamespace()) !== false) {
            $parts = explode('\\', $this->getBundleNamespace());
            return array_pop($parts);
        }
        return $this->getBundleNamespace();
    }
114387
final public function getNamespace(): string
    {
        if (null === $this->namespace) {
            $pos             = strrpos(static::class, '\\');
            $this->namespace = false === $pos ? '' : substr(static::class, 0, $pos);
        }

        return $this->namespace;
    }
1007175
private function findFileNamespaces()
    {
        $namespaces = array();

        // namespaces can be only top-level nodes, so we can scan them directly
        foreach ($this->topLevelNodes as $topLevelNode) {
            if ($topLevelNode instanceof Namespace_) {
                $namespaceName = $topLevelNode->name ? $topLevelNode->name->toString() : '';

                $namespaces[$namespaceName] = new ReflectionFileNamespace(
                    $this->fileName,
                    $namespaceName,
                    $topLevelNode
                );
            }
        }

        return $namespaces;
    }
708755
protected function getVersionNamespace()
    {
        $version = $this->api()->getVersion();
        $supported = $this->getSupportedVersionNamespace();

        if (isset($supported[$version])) {
            return $supported[$version];
        }

        return 'Base';
    }
386754
public function getNamespaceName()
    {
        $parts = $this->node->consts[0]->namespacedName->parts;
        array_pop($parts);
        return implode('\\', $parts);
    }