File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -5727,15 +5727,17 @@ public function getIterableValueType(Type $iteratee): Type
57275727
57285728 public function getPhpVersion (): PhpVersions
57295729 {
5730- $ name = new Name ( 'PHP_VERSION_ID ' );
5731- if (! $ this -> hasConstant ( $ name )) {
5732- if (is_array ( $ this ->configPhpVersion )) {
5733- return new PhpVersions (IntegerRangeType:: fromInterval ( $ this ->configPhpVersion [ ' min ' ], $ this -> configPhpVersion [ ' max ' ] ));
5730+ foreach ([ 'PHP_VERSION_ID ' , '\\ PHP_VERSION_ID ' ] as $ constName ) {
5731+ $ versionExpr = new ConstFetch ( new Name ( $ constName ));
5732+ if ($ this ->hasExpressionType ( $ versionExpr )-> yes ( )) {
5733+ return new PhpVersions ($ this ->getType ( $ versionExpr ));
57345734 }
5735- return new PhpVersions (new ConstantIntegerType ($ this ->phpVersion ->getVersionId ()));
57365735 }
57375736
5738- return new PhpVersions ($ this ->getType (new ConstFetch ($ name )));
5737+ if (is_array ($ this ->configPhpVersion )) {
5738+ return new PhpVersions (IntegerRangeType::fromInterval ($ this ->configPhpVersion ['min ' ], $ this ->configPhpVersion ['max ' ]));
5739+ }
5740+ return new PhpVersions (new ConstantIntegerType ($ this ->phpVersion ->getVersionId ()));
57395741 }
57405742
57415743}
You can’t perform that action at this time.
0 commit comments