Phan\Analysis\ScopeVisitor::visitDeclare PHP Method

visitDeclare() public method

Visit a node with kind \ast\AST_DECLARE
public visitDeclare ( 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 visitDeclare(Node $node) : Context
    {
        $declares = $node->children['declares'];
        $name = $declares->children[0]->children['name'];
        $value = $declares->children[0]->children['value'];
        if ('strict_types' === $name) {
            return $this->context->withStrictTypes($value);
        }
        return $this->context;
    }