public visitCoalesce ( ast\Node $node ) : |
||
$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 | 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;
}