Skip to content

Commit d2a90f6

Browse files
phpstan-botclaude
andcommitted
Use UnionType directly instead of TypeCombinator::union for ClassStringType|ObjectWithoutClassType
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a993e8f commit d2a90f6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Type/IntersectionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ public function getOffsetValueType(Type $offsetType): Type
942942
if ($callableArrayOffsetType->isSuperTypeOf($arrayKeyOffsetType)->yes()) {
943943
$narrowedTypes = [];
944944
if (!$arrayKeyOffsetType->isSuperTypeOf(new ConstantIntegerType(0))->no()) {
945-
$narrowedTypes[] = TypeCombinator::union(new ClassStringType(), new ObjectWithoutClassType());
945+
$narrowedTypes[] = new UnionType([new ClassStringType(), new ObjectWithoutClassType()]);
946946
}
947947
if (!$arrayKeyOffsetType->isSuperTypeOf(new ConstantIntegerType(1))->no()) {
948948
$narrowedTypes[] = new StringType();

0 commit comments

Comments
 (0)