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 3434final class ConstantResolver
3535{
3636
37+ public const int PHP_MIN_VERSION_ID = 50207 ;
38+
3739 /** @var array<string, true> */
3840 private array $ currentlyResolving = [];
3941
@@ -141,7 +143,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
141143 return $ this ->createInteger ($ minRelease , $ maxRelease );
142144 }
143145 if ($ resolvedConstantName === 'PHP_VERSION_ID ' ) {
144- $ minVersion = 50207 ;
146+ $ minVersion = self :: PHP_MIN_VERSION_ID ;
145147 $ maxVersion = null ;
146148 if ($ minPhpVersion !== null ) {
147149 $ 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
62356235
62366236 public function getPhpVersion (): PhpVersions
62376237 {
6238+ $ minPhpVersion = IntegerRangeType::fromInterval (ConstantResolver::PHP_MIN_VERSION_ID , null );
6239+
62386240 $ constType = $ this ->getGlobalConstantType (new Name ('PHP_VERSION_ID ' ));
6239- if ($ constType !== null ) {
6241+ if ($ constType !== null && ! $ minPhpVersion -> isSuperTypeOf ( $ constType )-> yes () ) {
62406242 return new PhpVersions ($ constType );
62416243 }
62426244
You can’t perform that action at this time.
0 commit comments