File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 34
34
final class ConstantResolver
35
35
{
36
36
37
- public const PHP_MIN_VERSION_ID = 50207 ;
37
+ public const PHP_MIN_ANALYZABLE_VERSION_ID = 50207 ;
38
38
39
39
/** @var array<string, true> */
40
40
private array $ currentlyResolving = [];
@@ -143,7 +143,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
143
143
return $ this ->createInteger ($ minRelease , $ maxRelease );
144
144
}
145
145
if ($ resolvedConstantName === 'PHP_VERSION_ID ' ) {
146
- $ minVersion = self ::PHP_MIN_VERSION_ID ;
146
+ $ minVersion = self ::PHP_MIN_ANALYZABLE_VERSION_ID ;
147
147
$ maxVersion = null ;
148
148
if ($ minPhpVersion !== null ) {
149
149
$ minVersion = max ($ minVersion , $ minPhpVersion ->getVersionId ());
Original file line number Diff line number Diff line change 52
52
use PHPStan \Parser \NewAssignedToPropertyVisitor ;
53
53
use PHPStan \Parser \Parser ;
54
54
use PHPStan \Php \PhpVersion ;
55
+ use PHPStan \Php \PhpVersionFactory ;
55
56
use PHPStan \Php \PhpVersions ;
56
57
use PHPStan \PhpDoc \Tag \TemplateTag ;
57
58
use PHPStan \Reflection \Assertions ;
@@ -6235,10 +6236,10 @@ public function getIterableValueType(Type $iteratee): Type
6235
6236
6236
6237
public function getPhpVersion (): PhpVersions
6237
6238
{
6238
- $ minPhpVersion = IntegerRangeType::fromInterval (ConstantResolver::PHP_MIN_VERSION_ID , null );
6239
+ $ overallPhpVersionRange = IntegerRangeType::fromInterval (ConstantResolver::PHP_MIN_ANALYZABLE_VERSION_ID , PhpVersionFactory:: MAX_PHP_VERSION );
6239
6240
6240
6241
$ constType = $ this ->getGlobalConstantType (new Name ('PHP_VERSION_ID ' ));
6241
- if ($ constType !== null && !$ constType ->isSuperTypeOf ( $ minPhpVersion )-> yes ( )) {
6242
+ if ($ constType !== null && !$ constType ->equals ( $ overallPhpVersionRange )) {
6242
6243
return new PhpVersions ($ constType );
6243
6244
}
6244
6245
You can’t perform that action at this time.
0 commit comments