File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 34
34
final class ConstantResolver
35
35
{
36
36
37
+ public const int PHP_MIN_VERSION_ID = 50207 ;
38
+
37
39
/** @var array<string, true> */
38
40
private array $ currentlyResolving = [];
39
41
@@ -141,7 +143,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
141
143
return $ this ->createInteger ($ minRelease , $ maxRelease );
142
144
}
143
145
if ($ resolvedConstantName === 'PHP_VERSION_ID ' ) {
144
- $ minVersion = 50207 ;
146
+ $ minVersion = self :: PHP_MIN_VERSION_ID ;
145
147
$ maxVersion = null ;
146
148
if ($ minPhpVersion !== null ) {
147
149
$ minVersion = max ($ minVersion , $ minPhpVersion ->getVersionId ());
Original file line number Diff line number Diff line change @@ -6235,8 +6235,10 @@ public function getIterableValueType(Type $iteratee): Type
6235
6235
6236
6236
public function getPhpVersion (): PhpVersions
6237
6237
{
6238
+ $ minPhpVersion = IntegerRangeType::fromInterval (ConstantResolver::PHP_MIN_VERSION_ID , null );
6239
+
6238
6240
$ constType = $ this ->getGlobalConstantType (new Name ('PHP_VERSION_ID ' ));
6239
- if ($ constType !== null ) {
6241
+ if ($ constType !== null && ! $ minPhpVersion -> isSuperTypeOf ( $ constType )-> yes () ) {
6240
6242
return new PhpVersions ($ constType );
6241
6243
}
6242
6244
You can’t perform that action at this time.
0 commit comments