We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a993e8f commit d2a90f6Copy full SHA for d2a90f6
1 file changed
src/Type/IntersectionType.php
@@ -942,7 +942,7 @@ public function getOffsetValueType(Type $offsetType): Type
942
if ($callableArrayOffsetType->isSuperTypeOf($arrayKeyOffsetType)->yes()) {
943
$narrowedTypes = [];
944
if (!$arrayKeyOffsetType->isSuperTypeOf(new ConstantIntegerType(0))->no()) {
945
- $narrowedTypes[] = TypeCombinator::union(new ClassStringType(), new ObjectWithoutClassType());
+ $narrowedTypes[] = new UnionType([new ClassStringType(), new ObjectWithoutClassType()]);
946
}
947
if (!$arrayKeyOffsetType->isSuperTypeOf(new ConstantIntegerType(1))->no()) {
948
$narrowedTypes[] = new StringType();
0 commit comments