Skip to content

Commit b7c6318

Browse files
committed
new fix
1 parent e6d83e4 commit b7c6318

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Analyser/MutatingScope.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6236,10 +6236,18 @@ public function getIterableValueType(Type $iteratee): Type
62366236

62376237
public function getPhpVersion(): PhpVersions
62386238
{
6239-
$overallPhpVersionRange = IntegerRangeType::fromInterval(ConstantResolver::PHP_MIN_ANALYZABLE_VERSION_ID, PhpVersionFactory::MAX_PHP_VERSION);
6240-
62416239
$constType = $this->getGlobalConstantType(new Name('PHP_VERSION_ID'));
6242-
if ($constType !== null && !$constType->equals($overallPhpVersionRange)) {
6240+
6241+
$isOverallPhpVersionRange = false;
6242+
if (
6243+
$constType instanceof IntegerRangeType
6244+
&& $constType->getMin() === ConstantResolver::PHP_MIN_ANALYZABLE_VERSION_ID
6245+
&& ($constType->getMax() === null || $constType->getMax() === PhpVersionFactory::MAX_PHP_VERSION)
6246+
) {
6247+
$isOverallPhpVersionRange = true;
6248+
}
6249+
6250+
if ($constType !== null && !$isOverallPhpVersionRange) {
62436251
return new PhpVersions($constType);
62446252
}
62456253

0 commit comments

Comments
 (0)