Skip to content

Commit

Permalink
[NodeTypeResolver] Remove normalize iterable type on TypeHasher
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Sep 21, 2024
1 parent 3c50a47 commit 8a68cb5
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/NodeTypeResolver/PHPStan/TypeHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use PHPStan\Type\ArrayType;
use PHPStan\Type\ConstantType;
use PHPStan\Type\Generic\GenericObjectType;
use PHPStan\Type\IterableType;
use PHPStan\Type\MixedType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
Expand Down Expand Up @@ -48,20 +47,6 @@ public function createTypeHash(Type $type): string
}

$type = $this->normalizeObjectType($type);

// normalize iterable
$type = TypeTraverser::map($type, static function (Type $currentType, callable $traverseCallback): Type {
if (! $currentType instanceof ObjectType) {
return $traverseCallback($currentType);
}

if ($currentType->getClassName() === 'iterable') {
return new IterableType(new MixedType(), new MixedType());
}

return $traverseCallback($currentType);
});

return $type->describe(VerbosityLevel::value());
}

Expand Down

0 comments on commit 8a68cb5

Please sign in to comment.