public function leaveNode(Node $node)
    {
        if ($node instanceof ConstFetch && \count($node->name->parts) > 1) {
            $name = $this->getFullyQualifiedName($node->name);
            if (!\defined($name)) {
                $msg = \sprintf('Undefined constant %s', $name);
                throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
            }
        } elseif ($node instanceof ClassConstFetch) {
            $this->validateClassConstFetchExpression($node);
        }
    }
public function leaveNode(Node $node)
    {
        if ($node instanceof ConstFetch && \count($node->name->parts) > 1) {
            $name = $this->getFullyQualifiedName($node->name);
            if (!\defined($name)) {
                $msg = \sprintf('Undefined constant %s', $name);
                throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
            }
        } elseif ($node instanceof ClassConstFetch) {
            $this->validateClassConstFetchExpression($node);
        }
    }
public function leaveNode ( Node $ node ) { if ( $ node instanceof ConstFetch && \ count ( $ node -> name -> parts ) > 1 ) { $ name = $ this -> getFullyQualifiedName ( $ node -> name ) ; if ( ! \ defined ( $ name ) ) { $ msg = \ sprintf ( 'Undefined constant %s' , $ name ) ; throw new FatalErrorException ( $ msg , 0 , E_ERROR , null , $ node -> getLine ( ) ) ; } } elseif ( $ node instanceof ClassConstFetch ) { $ this -> validateClassConstFetchExpression ( $ node ) ; } }
Validate that namespaced constant references will succeed.

Note that this does not (yet) detect constants defined in the current code
snippet. It won't happen very often, so we'll punt for now.

@throws FatalErrorException if a constant reference is not defined

@param Node $node
Validate that namespaced constant references will succeed .