Skip to content

Commit 92ad9d2

Browse files
committed
Scope: fix getPhpVersion() in non-namespaced files
1 parent c5df243 commit 92ad9d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Analyser/MutatingScope.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5728,15 +5728,15 @@ public function getIterableValueType(Type $iteratee): Type
57285728

57295729
public function getPhpVersion(): PhpVersions
57305730
{
5731-
$versionExpr = new ConstFetch(new Name('PHP_VERSION_ID'));
5732-
if (!$this->hasExpressionType($versionExpr)->yes()) {
5731+
$name = new Name('PHP_VERSION_ID');
5732+
if (!$this->hasConstant($name)) {
57335733
if (is_array($this->configPhpVersion)) {
57345734
return new PhpVersions(IntegerRangeType::fromInterval($this->configPhpVersion['min'], $this->configPhpVersion['max']));
57355735
}
57365736
return new PhpVersions(new ConstantIntegerType($this->phpVersion->getVersionId()));
57375737
}
57385738

5739-
return new PhpVersions($this->getType($versionExpr));
5739+
return new PhpVersions($this->getType(new ConstFetch($name)));
57405740
}
57415741

57425742
}

0 commit comments

Comments
 (0)