protected function resolveClassName(Name $name): Name
    {
        // Skip all names except special `self`
        if (strtolower($name->toString()) !== 'self') {
            return $name;
        }

        // Save the original name
        $originalName = $name;
        $name = clone $originalName;
        $name->setAttribute('originalName', $originalName);

        $fullClassName    = Name::concat($this->namespace, $this->className);
        $resolvedSelfName = new FullyQualified('\\' . ltrim($fullClassName->toString(), '\\'), $name->getAttributes());

        $this->replacedNodes[] = $resolvedSelfName;

        return $resolvedSelfName;
    }
protected function resolveClassName(Name $name): Name
    {
        // Skip all names except special `self`
        if (strtolower($name->toString()) !== 'self') {
            return $name;
        }

        // Save the original name
        $originalName = $name;
        $name = clone $originalName;
        $name->setAttribute('originalName', $originalName);

        $fullClassName    = Name::concat($this->namespace, $this->className);
        $resolvedSelfName = new FullyQualified('\\' . ltrim($fullClassName->toString(), '\\'), $name->getAttributes());

        $this->replacedNodes[] = $resolvedSelfName;

        return $resolvedSelfName;
    }
protected function resolveClassName ( Name $ name ) : Name { // Skip all names except special `self` if ( strtolower ( $ name -> toString ( ) ) !== 'self' ) { return $ name ; } // Save the original name $ originalName = $ name ; $ name = clone $ originalName ; $ name -> setAttribute ( 'originalName' , $ originalName ) ; $ fullClassName = Name :: concat ( $ this -> namespace , $ this -> className ) ; $ resolvedSelfName = new FullyQualified ( '\\' . ltrim ( $ fullClassName -> toString ( ) , '\\' ) , $ name -> getAttributes ( ) ) ; $ this -> replacedNodes [ ] = $ resolvedSelfName ; return $ resolvedSelfName ; }
Resolves `self` class name with value

@param Name $name Instance of original node

@return Name|FullyQualified
Resolves self class name with value