Resolve an unqualified name to fully qualified name.

@param string $name
The unqualified name to resolve.

@return string
Fully qualified name.
558027
protected function resolveUnqualified($name) {
    if ($this->parent instanceof NamespaceNode) {
      return '\\' . $name;
    }
    if ($this->parent instanceof UseDeclarationNode) {
      return '\\' . $name;
    }
    $namespace = $this->getNamespace();
    $use_declarations = array();
    if ($namespace) {
      $use_declarations = $namespace->getBody()->getUseDeclarations();
    }
    else {
      /** @var \Pharborist\RootNode $root_node */
      $root_node = $this->closest(Filter::isInstanceOf('\Pharborist\RootNode'));
      if ($root_node) {
        $use_declarations = $root_node->getUseDeclarations();
      }
    }
    if ($this->parent instanceof FunctionCallNode) {
      /** @var UseDeclarationNode $use_declaration */
      foreach ($use_declarations as $use_declaration) {
        if ($use_declaration->isFunction() && $use_declaration->getBoundedName() === $name) {
          return '\\' . $use_declaration->getName()->getPath();
        }
      }
      return $this->getParentPath() . $name;
    }
    elseif ($this->parent instanceof ConstantNode) {
      /** @var UseDeclarationNode $use_declaration */
      foreach ($use_declarations as $use_declaration) {
        if ($use_declaration->isConst() && $use_declaration->getBoundedName() === $name) {
          return '\\' . $use_declaration->getName()->getPath();
        }
      }
      return $this->getParentPath() . $name;
    }
    else {
      // Name is a class reference.
      /** @var UseDeclarationNode $use_declaration */
      foreach ($use_declarations as $use_declaration) {
        if ($use_declaration->isClass() && $use_declaration->getBoundedName() === $name) {
          return '\\' . $use_declaration->getName()->getPath();
        }
      }
      // No use declaration so class name refers to class in current namespace.
      return $this->getParentPath() . $name;
    }
  }
209657
protected function resolveName($name, $includeFunctions = false)
    {
        $shell = $this->getApplication();

        // While not *technically* 100% accurate, let's treat `self` and `static` as equivalent.
        if (\in_array(\strtolower($name), ['self', 'static'])) {
            if ($boundClass = $shell->getBoundClass()) {
                return $boundClass;
            }

            if ($boundObject = $shell->getBoundObject()) {
                return \get_class($boundObject);
            }

            $msg = \sprintf('Cannot use "%s" when no class scope is active', \strtolower($name));
            throw new ErrorException($msg, 0, E_USER_ERROR, "eval()'d code", 1);
        }

        if (\substr($name, 0, 1) === '\\') {
            return $name;
        }

        if ($namespace = $shell->getNamespace()) {
            $fullName = $namespace . '\\' . $name;

            if (\class_exists($fullName) || \interface_exists($fullName) || ($includeFunctions && \function_exists($fullName))) {
                return $fullName;
            }
        }

        return $name;
    }
1373860
public function name( $name = null )
	{
		if ( is_null( $name ) )
		{
			return $this->_instance_name;
		}
		
		$this->_instance_name = $name;
	}
1120110
protected function resolvePath($name)
    {
        try {
            $path = RelativePath::fromString($name);
        } catch (NonRelativePathException $exception) {
            $path = AbsolutePath::fromString($name);
        }
        $resultPath = $this->rootPath->resolve($path);

        return $resultPath->normalize()->string();
    }
1211477
public static function convertName($name)
    {
        if (0 === strpos($name, '@') && false !== strpos($name, '/')) {
            $name = ltrim(str_replace('/', '--', $name), '@');
        }

        return $name;
    }
488232
protected function getName($name)
    {
        $name = parent::getName($name);

        // This fixes any URL encoded filename and sanitize it
        $name = strtolower(urldecode($name));

        // Replace spaces with a dash
        $name = preg_replace('!\s+!', '-', $name);

        // Remove odd characters
        return preg_replace('/[^A-Za-z0-9\-_\.]/', '', $name);
    }
612878
protected function resolve($name)
    {
        $config = $this->getConfig($name);

        return $this->getConnector($config['driver'])->connect($config);
    }
1038065
private function findAlias(Name $name)
    {
        $that = \strtolower($name);
        foreach ($this->aliases as $alias => $prefix) {
            if ($that === $alias) {
                return new FullyQualifiedName($prefix->toString());
            } elseif (\substr($that, 0, \strlen($alias) + 1) === $alias . '\\') {
                return new FullyQualifiedName($prefix->toString() . \substr($name, \strlen($alias)));
            }
        }
    }
540752
function resolve($name)
    {
        $name = (string) $name;
        if (!array_key_exists($name, $this->_t_loader_map_resource_MapRes))
            return false;

        return $this->_t_loader_map_resource_MapRes[$name];
    }
90445
private function resolveClassName($name) {
        $name = str_replace('/', '\\', trim($name));

        // no need to resolve a qualified name
        if (strContains($name, '\\'))
            return is_class($name) ? [$name] : [];

        // unqualified name, check "use" declarations
        $lowerName = strtolower($name);
        if (isset($this->uses[$lowerName]))
            return [$this->uses[$lowerName]];

        // unqualified name, check imported namespaces
        $results = [];
        foreach ($this->imports as $namespace) {
            $class = $namespace.$name;
            if (is_class($class))
                $results[] = $class;
        }
        return $results;
    }
245352
protected static function resolveFacadeInstance($name)
		{
			if (is_object($name)) {
				return $name;
			}

			if (isset(static::$resolvedInstance[$name])) {
				return static::$resolvedInstance[$name];
			}

			return false;
		}
918589
public function name($name)
    {
        $prefix = !is_null($this->associatedEntity) && $this->associatedEntity->isSupportedAttribute($name) ?
            $this->keys['POST_WRAP'] . '[' . $this->associatedEntity->getInputName() . ']' :
            $this->keys['POST_WRAP'];

        // Transforms user[name] to data[user][name];
        if (preg_match('/^(.+?)\[(.+)?/', $name, $matches)) {
            return $prefix . '[' . $matches[1].'][' . $matches[2];
        }

        // Transforms user to data[user]
        return $prefix . '[' . $name . ']';
    }
799631
protected static function resolveFacadeInstance($name)
    {
        if (is_object($name)) {
            return $name;
        }

        if (isset(static::$resolvedInstance[$name])) {
            return static::$resolvedInstance[$name];
        }

        return static::$resolvedInstance[$name] = static::$app->getContainer()->get($name);
    }
29760
public function name($name = null)
    {
        if (null === $name) {
            return $this->name;
        }

        $this->name = $name;

        return $this;
    }
426844
protected function resolveName(Name $name, $type) {
        $resolvedName = $this->nameContext->getResolvedName($name, $type);
        if (null !== $resolvedName) {
            $name->setAttribute('resolvedName', $resolvedName->toString());
        }
        return $name;
    }
297225
private function fullyQualifiedDatabaseName($name)
    {
        $instance = InstanceAdminClient::parseName($this->instance->name())['instance'];

        try {
            return GapicSpannerClient::databaseName(
                $this->projectId,
                $instance,
                $name
            );
        //@codeCoverageIgnoreStart
        } catch (ValidationException $e) {
            return $name;
        }
        //@codeCoverageIgnoreEnd
    }
1002082
public function normalizeDefinitionName(string $name): string
    {
        $elements = explode('/', $name);

        return $elements[count($elements) - 1];
    }