Phan\Analysis\PostOrderAnalysisVisitor::visitGlobal PHP Method

visitGlobal() public method

Visit a node with kind \ast\AST_GLOBAL
public visitGlobal ( ast\Node $node ) : Context
$node ast\Node A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node
    public function visitGlobal(Node $node) : Context
    {
        $variable = Variable::fromNodeInContext($node->children['var'], $this->context, $this->code_base, false);
        // Note that we're not creating a new scope, just
        // adding variables to the existing scope
        $this->context->addScopeVariable($variable);
        return $this->context;
    }