Skip to content

Commit 7d8ac24

Browse files
committed
Improved compatibility with PHPStan 1.0
1 parent 84541f0 commit 7d8ac24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Type/Symfony/ParameterDynamicReturnTypeExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use PHPStan\Type\ConstantType;
1616
use PHPStan\Type\DynamicMethodReturnTypeExtension;
1717
use PHPStan\Type\FloatType;
18+
use PHPStan\Type\GeneralizePrecision;
1819
use PHPStan\Type\IntegerType;
1920
use PHPStan\Type\MixedType;
2021
use PHPStan\Type\NullType;
@@ -117,7 +118,7 @@ private function generalizeType(Type $type): Type
117118
return new ArrayType($this->generalizeType($type->getKeyType()), $this->generalizeType($type->getItemType()));
118119
}
119120
if ($type instanceof ConstantType) {
120-
return $type->generalize();
121+
return $type->generalize(GeneralizePrecision::lessSpecific());
121122
}
122123
return $traverse($type);
123124
});

0 commit comments

Comments
 (0)