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 3434final class ConstantResolver
3535{
3636
37- public const PHP_MIN_VERSION_ID = 50207 ;
37+ public const PHP_MIN_ANALYZABLE_VERSION_ID = 50207 ;
3838
3939 /** @var array<string, true> */
4040 private array $ currentlyResolving = [];
@@ -143,7 +143,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
143143 return $ this ->createInteger ($ minRelease , $ maxRelease );
144144 }
145145 if ($ resolvedConstantName === 'PHP_VERSION_ID ' ) {
146- $ minVersion = self ::PHP_MIN_VERSION_ID ;
146+ $ minVersion = self ::PHP_MIN_ANALYZABLE_VERSION_ID ;
147147 $ maxVersion = null ;
148148 if ($ minPhpVersion !== null ) {
149149 $ minVersion = max ($ minVersion , $ minPhpVersion ->getVersionId ());
Original file line number Diff line number Diff line change 5252use PHPStan \Parser \NewAssignedToPropertyVisitor ;
5353use PHPStan \Parser \Parser ;
5454use PHPStan \Php \PhpVersion ;
55+ use PHPStan \Php \PhpVersionFactory ;
5556use PHPStan \Php \PhpVersions ;
5657use PHPStan \PhpDoc \Tag \TemplateTag ;
5758use PHPStan \Reflection \Assertions ;
@@ -6235,10 +6236,10 @@ public function getIterableValueType(Type $iteratee): Type
62356236
62366237 public function getPhpVersion (): PhpVersions
62376238 {
6238- $ minPhpVersion = IntegerRangeType::fromInterval (ConstantResolver::PHP_MIN_VERSION_ID , null );
6239+ $ overallPhpVersionRange = IntegerRangeType::fromInterval (ConstantResolver::PHP_MIN_ANALYZABLE_VERSION_ID , PhpVersionFactory:: MAX_PHP_VERSION );
62396240
62406241 $ constType = $ this ->getGlobalConstantType (new Name ('PHP_VERSION_ID ' ));
6241- if ($ constType !== null && !$ constType ->isSuperTypeOf ( $ minPhpVersion )-> yes ( )) {
6242+ if ($ constType !== null && !$ constType ->equals ( $ overallPhpVersionRange )) {
62426243 return new PhpVersions ($ constType );
62436244 }
62446245
You can’t perform that action at this time.
0 commit comments