Phan\AST\UnionTypeVisitor::visitCoalesce PHP 메소드

visitCoalesce() 공개 메소드

Visit a node with kind \ast\AST_COALESCE
public visitCoalesce ( 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.
리턴 Phan\Language\UnionType The set of types that are possibly produced by the given node
    public function visitCoalesce(Node $node) : UnionType
    {
        $union_type = new UnionType();
        $left_type = self::unionTypeFromNode($this->code_base, $this->context, $node->children['left']);
        $union_type->addUnionType($left_type);
        $right_type = self::unionTypeFromNode($this->code_base, $this->context, $node->children['right']);
        $union_type->addUnionType($right_type);
        return $union_type;
    }