isLegalUnionType($type); } return \true; } private function isLegalUnionType(UnionType $type) : bool { foreach ($type->getTypes() as $unionType) { if ($unionType instanceof MixedType) { return \false; } } return \true; } }