Type doesn't have to be serialized in order to be hashed

This commit is contained in:
Ondrej Mirtes 2020-06-08 00:13:38 +02:00
parent bfd86240fd
commit 03d4f0d5b1
No known key found for this signature in database
GPG Key ID: 8E730BA25823D8B5

View File

@ -16,6 +16,7 @@ use PHPStan\Type\ObjectType;
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use PHPStan\Type\UnionType;
use PHPStan\Type\VerbosityLevel;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\PHPStan\TypeFactoryStaticHelper;
@ -73,7 +74,7 @@ final class TypeFactory
$type = $this->removeValueFromConstantType($type);
}
$typeHash = md5(serialize($type));
$typeHash = md5($type->describe(VerbosityLevel::cache()));
$uniqueTypes[$typeHash] = $type;
}