Phan\AST\UnionTypeVisitor::visitInstanceOf PHP Method

visitInstanceOf() public method

Visit a node with kind \ast\AST_INSTANCEOF
public visitInstanceOf ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node
    public function visitInstanceOf(Node $node) : UnionType
    {
        // Check to make sure the left side is valid
        UnionType::fromNode($this->context, $this->code_base, $node->children['expr']);
        try {
            // Confirm that the right-side exists
            $union_type = $this->visitClassNode($node->children['class']);
        } catch (TypeException $exception) {
            // TODO: log it?
        }
        return BoolType::instance()->asUnionType();
    }