app namespace accessor.

@access  public
@return  string
968578
public function appNameSpace()
    {
        $app_dir = $this->appDir();
        $root_dir = $this->rootDir();
        $ns_path = substr($app_dir, strlen($root_dir) + 1);
        return str_replace(DS, '\\', $ns_path);
    }
574624
public function getNamespace()
    {
        if (! is_null($this->namespace)) {
            return $this->namespace;
        }

        $composer = json_decode(file_get_contents(base_path('composer.json')), true);

        foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
            foreach ((array) $path as $pathChoice) {
                if (realpath(app()->path()) == realpath(base_path().'/'.$pathChoice)) {
                    return $this->namespace = $namespace;
                }
            }
        }

        throw new RuntimeException('Unable to detect application namespace.');
    }
237766
public function parseNamespace()
    {
        $name = '';
        while (($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR)) {
            $name .= $token[1];
        }

        return $name;
    }
999495
private function _namespace() {
    $node = new NamespaceNode();
    $this->matchDocComment($node);
    $this->mustMatch(T_NAMESPACE, $node);
    if ($this->currentType === T_STRING) {
      $name = $this->namespaceName();
      $node->addChild($name, 'name');
    }
    $this->matchHidden($node);
    $body = new StatementBlockNode();
    if ($this->tryMatch('{', $body)) {
      $this->topStatementList($body, '}');
      $this->mustMatch('}', $body);
      $node->addChild($body, 'body');
    }
    else {
      $this->endStatement($node);
      $this->matchHidden($node);
      $node->addChild($this->namespaceBlock(), 'body');
    }
    return $node;
  }
816865
public function getRootNamespace()
    {
        if (($psr4 = $this->get('autoload.psr-4')) === null) {
            return null;
        }

        foreach ($psr4 as $namespace => $namespacePaths) {
            foreach ((array)$namespacePaths as $namespacePath) {
                // The namespace path should be a subdirectory of the "src" directory
                if (mb_strpos(realpath($this->rootPath . '/' . $namespacePath), realpath($this->psr4RootPath)) === 0) {
                    return rtrim($namespace, '\\');
                }
            }
        }

        return null;
    }
1283234
protected function _namespaceNode()
    {
        $this->_codeNode();
        $this->_flushUses();
        $body = $this->_stream->current();
        $name = $this->_stream->next([';', '{']);
        $this->_states['body'] .= $body;
        $node = new BlockDef($body . $name, 'namespace');
        $node->hasMethods = false;
        $node->name = trim(substr($name, 0, -1));
        $this->_states['current'] = $this->_root;
        $this->_contextualize($node);
        return $this->_states['current'] = $node->namespace = $node;
    }
1019933
public function getRootNamespace ()
	{
		
		$arr		= explode ('\\', $this->get ('namespace'));
		$table		= explode ('_', $this->get ('table'));
		$ns			= [];
		
		foreach ($arr as $nsSegment)
		{
			$tableSegment	= array_shift ($table);
			if (strtolower ($nsSegment) != strtolower ($tableSegment))
			{
				$ns[]	= $nsSegment;
				array_unshift ($table, $tableSegment);
			}
		}
		
		$namespace	= join ('\\', $ns) . '\\';
		
		return $namespace;
	}
1339324
protected function getContractNamespace($withApp = true)
    {
        // get path from settings
        $path = config('generators.settings.contract.namespace') . '\\';

        // dont add the default namespace if specified not to in config
        $path .= str_replace('/', '\\', $this->getArgumentPath());

        $pieces = array_map('ucfirst', explode('/', $path));

        $namespace = ($withApp === true ? $this->getAppNamespace() : '') . implode('\\', $pieces);

        $namespace = rtrim(ltrim(str_replace('\\\\', '\\', $namespace), '\\'), '\\');

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

      $nodeList = $this->documentElement->getElementsByTagName('*');

      foreach($nodeList as $node)
      {
        if (strlen($node->prefix) && strlen($node->namespaceURI) && !in_array($node->prefix, $this->namespaces))
          $this->namespaces[$node->prefix] = $node->namespaceURI;
      }

      return $this->namespaces;
    }
554340
public function getAppNames()
    {
        $apps = [];
        if ($projectRoot = $this->getWelcomeCommand()->getProjectRoot()) {
            foreach (LocalApplication::getApplications($projectRoot) as $app) {
                $name = $app->getName();
                if ($name !== null) {
                    $apps[] = $name;
                }
            }
        } elseif ($project = $this->getProject()) {
            if ($environment = $this->api->getEnvironment('master', $project, false)) {
                $apps = array_keys($environment->getSshUrls());
            }
        }

        return $apps;
    }
522488
public function getNamespace()
    {
        if (isset($this->properties[ 'namespace' ])) {
            return $this->properties[ 'namespace' ];
        }

        $dir = $this->getRealPath();
        $dirParts = explode('Widgets' . DIRECTORY_SEPARATOR, $dir);
        $namespace = loader()->getDirNamespace(reset($dirParts)) . 'Widgets\\' . str_replace(['/', DIRECTORY_SEPARATOR],
                '\\', end($dirParts));

        return $namespace;
    }
617177
protected function getSoapNamespace(): string
    {
        if (!array_key_exists($this->soapVersion, static::SOAP_NAMESPACES)) {
            throw new InvalidArgumentException('Unsupported SOAP version');
        }

        return static::SOAP_NAMESPACES[$this->soapVersion];
    }
708755
protected function getVersionNamespace()
    {
        $version = $this->api()->getVersion();
        $supported = $this->getSupportedVersionNamespace();

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

        return 'Base';
    }
639779
public function namespaced_controller_file()
    {
        if (!$this->_modules)
            return false;
        return Rails::config()->paths->controllers . '/' . $this->namespace_path() . '/application_controller.php';
    }
658570
private function inspectApplication()
	{
		$this->commands   = [];
		$this->namespaces = [];

		$all = $this->application->getAllCommands($this->namespace ? $this->application->findNamespace($this->namespace) : '');

		foreach ($this->sortCommands($all) as $namespace => $commands)
		{
			$names = [];

			/** @var AbstractCommand $command */
			foreach ($commands as $name => $command)
			{
				if (!$command->getName() || (!$this->showHidden && $command->isHidden()))
				{
					continue;
				}

				if ($command->getName() === $name)
				{
					$this->commands[$name] = $command;
				}
				else
				{
					$this->aliases[$name] = $command;
				}

				$names[] = $name;
			}

			$this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names];
		}
	}
133292
protected function getModuleNamespace()
    {
        if (null === $this->moduleNamespace) {
            $class                 = get_class($this);
            $this->moduleNamespace = substr($class, 0, strpos($class, '\\'));
        }
        return $this->moduleNamespace;
    }
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;
    }