src/DefinitionResolver.php
public function resolveReferenceNodeToFqn(Node $node)
    {
        // TODO all name tokens should be a part of a node
        if ($node instanceof Node\QualifiedName) {
            return $this->resolveQualifiedNameNodeToFqn($node);
        } else if ($node instanceof Node\Expression\MemberAccessExpression) {
            return $this->resolveMemberAccessExpressionNodeToFqn($node);
        } else if (ParserHelpers\isConstantFetch($node)) {
            return (string)($node->getNamespacedName());
        } else if (
            // A\B::C - constant access expression
            $node instanceof Node\Expression\ScopedPropertyAccessExpression
            && !($node->memberName instanceof Node\Expression\Variable)
        ) {
            return $this->resolveScopedPropertyAccessExpressionNodeToFqn($node);
        } else if (
            // A\B::$c - static property access expression
            $node->parent instanceof Node\Expression\ScopedPropertyAccessExpression
        ) {
            return $this->resolveScopedPropertyAccessExpressionNodeToFqn($node->parent);
        }

        return null;
    }
public function resolveReferenceNodeToFqn(Node $node)
    {
        // TODO all name tokens should be a part of a node
        if ($node instanceof Node\QualifiedName) {
            return $this->resolveQualifiedNameNodeToFqn($node);
        } else if ($node instanceof Node\Expression\MemberAccessExpression) {
            return $this->resolveMemberAccessExpressionNodeToFqn($node);
        } else if (ParserHelpers\isConstantFetch($node)) {
            return (string)($node->getNamespacedName());
        } else if (
            // A\B::C - constant access expression
            $node instanceof Node\Expression\ScopedPropertyAccessExpression
            && !($node->memberName instanceof Node\Expression\Variable)
        ) {
            return $this->resolveScopedPropertyAccessExpressionNodeToFqn($node);
        } else if (
            // A\B::$c - static property access expression
            $node->parent instanceof Node\Expression\ScopedPropertyAccessExpression
        ) {
            return $this->resolveScopedPropertyAccessExpressionNodeToFqn($node->parent);
        }

        return null;
    }
public function resolveReferenceNodeToFqn ( Node $ node ) { // TODO all name tokens should be a part of a node if ( $ node instanceof Node \ QualifiedName ) { return $ this -> resolveQualifiedNameNodeToFqn ( $ node ) ; } else if ( $ node instanceof Node \ Expression \ MemberAccessExpression ) { return $ this -> resolveMemberAccessExpressionNodeToFqn ( $ node ) ; } else if ( ParserHelpers \ isConstantFetch ( $ node ) ) { return ( string ) ( $ node -> getNamespacedName ( ) ) ; } else if ( // A\B::C - constant access expression $ node instanceof Node \ Expression \ ScopedPropertyAccessExpression && ! ( $ node -> memberName instanceof Node \ Expression \ Variable ) ) { return $ this -> resolveScopedPropertyAccessExpressionNodeToFqn ( $ node ) ; } else if ( // A\B::$c - static property access expression $ node -> parent instanceof Node \ Expression \ ScopedPropertyAccessExpression ) { return $ this -> resolveScopedPropertyAccessExpressionNodeToFqn ( $ node -> parent ) ; } return null ; }
Given any node, returns the FQN of the symbol that is referenced
Returns null if the FQN could not be resolved or the reference node references a variable
May also return "static", "self" or "parent"

@param Node $node
@return string|null
Given any node returns the FQN of the symbol that is referenced Returns null if the FQN could not be resolved or the reference node references a variable May also return static self or parent