private function getCombinedType(array $types) : Type
{
if (count($types) === 0) {
return new MixedType(true);
}
$itemType = reset($types);
array_shift($types);
foreach ($types as $type) {
if ($itemType === null) {
$itemType = $type;
continue;
}
$itemType = $itemType->combineWith($type);
}
return $itemType;
}