Skip to content

Commit f1fc769

Browse files
committed
fix constant type
1 parent fbb9959 commit f1fc769

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rules/DowngradePhp80/Reflection/DefaultParameterValueResolver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use PHPStan\Reflection\ParameterReflection;
1212
use PHPStan\Type\Constant\ConstantArrayType;
1313
use PHPStan\Type\Constant\ConstantBooleanType;
14-
use PHPStan\Type\ConstantType;
1514
use PHPStan\Type\Type;
1615
use PHPStan\Type\VerbosityLevel;
1716
use Rector\Exception\ShouldNotHappenException;
@@ -41,7 +40,7 @@ private function resolveValueFromType(Type $constantType): ConstFetch | Expr
4140
if ($constantType instanceof ConstantArrayType) {
4241
$values = [];
4342
foreach ($constantType->getValueTypes() as $valueType) {
44-
if (! $valueType instanceof ConstantType) {
43+
if (! $valueType->isConstantValue()->yes()) {
4544
throw new ShouldNotHappenException();
4645
}
4746

0 commit comments

Comments
 (0)