Get the full namespace name for a given class.

@param  string  $name
@return string
338288
protected function getNamespace($name)
    {
        $name = str_replace('\\routes\\', '\\', $name);
        return trim(implode('\\', array_map('ucfirst', array_slice(explode('\\', studly_case($name)), 0, -1))), '\\');
    }
301266
private function getProcessorClassName($name)
    {
        $className = ucfirst($name) . 'Processor';

        foreach($this->processorNamespaces as $namespace) {
            $fullyQualifiedClassName = $namespace . '\\' . $className;
            if(class_exists($fullyQualifiedClassName)) {
                return $fullyQualifiedClassName;
            }
        }

        throw new \Exception('Class ' . $fullyQualifiedClassName . ' not found');
    }
11261
public static function getClassName($namespaceClass)
    {
        $lastSlashPosition = mb_strrpos($namespaceClass, '\\');
    
        if ($lastSlashPosition !== false) {
            return mb_substr($namespaceClass, $lastSlashPosition + 1);
        }
    
        return $namespaceClass;
    }
283333
private function namespaceFromLegacyNamespace($namespace, $className)
    {
        $qcn = str_replace('_', '\\', $className);

        $lastBackslash = strrpos($qcn, '\\');
        if ($lastBackslash) {
            $namespace = rtrim($namespace, '\\') . '\\' . substr($qcn, 0, $lastBackslash);
        }

        return $namespace;
    }
947882
protected function getNamespace($name)
    {
        $name = explode('\\', $name);
        
        unset($name[(count($name) - 1)]);

        $nameSpace = implode('\\', $name);

        return trim($nameSpace);
    }
727462
public function getClassName($name)
    {
        $name = $this->replaceDollar($name);
        $name = preg_replace_callback('#[/\{\}]+(\w)#', function ($matches) {
            return ucfirst($matches[1]);
        }, $name);
        $name = Inflector::classify($name);

        if (preg_match(self::BAD_CLASS_NAME_REGEX, $name)) {
            $name = '_'.$name;
        }

        return $name;
    }
1273255
protected function resolveKey($name)
    {
        if (false !== $pos = strrpos($name, $this->namespaceCharacter)) {
            $name = substr($name, $pos + 1);
        }

        return $name;
    }
470064
protected function getNamespace($directory = null, $name)
    {
        if (is_null($directory)) {

            $directory = $this->generateDirName($name);

            if($directory === false) {
                return str_replace('\\', '', $this->app->getNamespace());
            } else {
                return $this->app->getNamespace() . "\\" . $directory;
            }

        } elseif (($path = $this->generateDirName($name)) !== false) {
            $namespace = $this->app->getNamespace() . "\\{$directory}\\" . $path;

            return $namespace;
        } else {
            $namespace = $this->app->getNamespace() . "\\{$directory}";

            return $namespace;
        }
    }
312497
protected function getOptionName($name)
    {

        $nameSpace = $this->getOptionNameSpace();
        if (empty($nameSpace))
            return $name;

        return $nameSpace.'.'.$name;
    }
475116
private function namespaceName() {
    $node = new NameNode();
    $this->mustMatch(T_STRING, $node, NULL, TRUE);
    while ($this->tryMatch(T_NS_SEPARATOR, $node)) {
      $this->mustMatch(T_STRING, $node, NULL, TRUE);
    }
    return $node;
  }
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;
    }
1151726
protected function getName($name)
    {
        $renames = $this->getRenames();

        if (isset($renames[$name])) {
            return $renames[$name];
        }
        return $name;
    }
433130
public function getFullQualifiedNamespace() {
        if(empty($this->fullQualifiedNamespace) && !empty($this->class)){
            $this->fullQualifiedNamespace = $this->getFullQualifiedNamespaceTrait($this->namespace, $this->class);
        }

        return $this->fullQualifiedNamespace;
    }
1176882
public function getNamespace($class_name)
	{
		$class_name = trim($class_name, '\\');
		if ($last_separator = strrpos($class_name, '\\'))
		{
			return substr($class_name, 0, $last_separator + 1);
		}
		return '';
	}
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];
  }
1353438
public function get_namespace_parts( $classname, $first_only = false ) {
		// Trim any left-slashes from our string
		$classname = ltrim( $classname, '\\' );

		if ( $first_only === true ) {
			return substr( $classname, 0, strpos( $classname, '\\' ) );
		}

		return explode( '\\', $classname );
	}
22049
public function getNamespace(): string
    {
        if(null === $this->namespace)
        {
            $this->namespace = str_replace(DIRECTORY_SEPARATOR, '\\', dirname(str_replace('\\', DIRECTORY_SEPARATOR, static::class)));
        }
        return $this->namespace;
    }