Phan\AST\UnionTypeVisitor::visitUnaryOp PHP Method

visitUnaryOp() public method

Visit a node with kind \ast\AST_UNARY_OP
public visitUnaryOp ( 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 visitUnaryOp(Node $node) : UnionType
    {
        // Shortcut some easy operators
        switch ($node->flags) {
            case \ast\flags\UNARY_BOOL_NOT:
                return BoolType::instance()->asUnionType();
        }
        return self::unionTypeFromNode($this->code_base, $this->context, $node->children['expr']);
    }