Skip to content

Commit e504202

Browse files
committed
Fix
1 parent 850807e commit e504202

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

rules/Privatization/TypeManipulator/TypeNormalizer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public function generalizeConstantBoolTypes(Type $type): Type
5757
*/
5858
public function generalizeConstantTypes(Type $type): Type
5959
{
60-
return TypeTraverser::map($type, function (Type $type, callable $traverseCallback): Type {
60+
$originalType = $type;
61+
return TypeTraverser::map($type, function (Type $type, callable $traverseCallback) use ($originalType): Type {
6162
if ($type instanceof AccessoryNonFalsyStringType || $type instanceof AccessoryLiteralStringType || $type instanceof AccessoryNonEmptyStringType) {
6263
return new StringType();
6364
}
@@ -81,7 +82,7 @@ public function generalizeConstantTypes(Type $type): Type
8182
if ($type instanceof ConstantArrayType) {
8283
// is relevant int constantArrayType?
8384
if ($this->isImplicitNumberedListKeyType($type)) {
84-
$keyType = new MixedType();
85+
$keyType = $originalType === $type ? new MixedType() : new IntegerType();
8586
} else {
8687
$keyType = $this->generalizeConstantTypes($type->getKeyType());
8788
}

0 commit comments

Comments
 (0)