File tree Expand file tree Collapse file tree 5 files changed +9
-8
lines changed
Expand file tree Collapse file tree 5 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -5723,9 +5723,14 @@ public function getIterableValueType(Type $iteratee): Type
57235723 return $ iteratee ->getIterableValueType ();
57245724 }
57255725
5726- public function getPhpVersions (): PhpVersions
5726+ public function getPhpVersion (): PhpVersions
57275727 {
5728- $ versionId = $ this ->getType (new ConstFetch (new Name ('PHP_VERSION_ID ' )));
5728+ $ versionExpr = new ConstFetch (new Name ('PHP_VERSION_ID ' ));
5729+ if (!$ this ->hasExpressionType ($ versionExpr )->yes ()) {
5730+ return new PhpVersions ([$ this ->phpVersion ->getVersionId ()]);
5731+ }
5732+
5733+ $ versionId = $ this ->getType ($ versionExpr );
57295734 if ($ versionId instanceof IntegerRangeType) {
57305735 if ($ versionId ->getMin () !== null && $ versionId ->getMax () !== null ) {
57315736 return new PhpVersions ([$ versionId ->getMin (), $ versionId ->getMax ()]);
Original file line number Diff line number Diff line change @@ -137,6 +137,6 @@ public function filterByFalseyValue(Expr $expr): self;
137137
138138 public function isInFirstLevelStatement (): bool ;
139139
140- public function getPhpVersions (): PhpVersions ;
140+ public function getPhpVersion (): PhpVersions ;
141141
142142}
Original file line number Diff line number Diff line change @@ -248,9 +248,6 @@ public function supportsPassNoneEncodings(): bool
248248 return $ this ->versionId < 70300 ;
249249 }
250250
251- /**
252- * @deprecated use PhpVersions::producesWarningForFinalPrivateMethods() instead
253- */
254251 public function producesWarningForFinalPrivateMethods (): bool
255252 {
256253 return $ this ->versionId >= 80000 ;
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ final class PhpVersions
1818 private int $ maxVersionId ;
1919
2020 /**
21- * @api
2221 * @param list<int> $phpVersionIds
2322 */
2423 public function __construct (
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function getNodeType(): string
2121 public function processNode (Node $ node , Scope $ scope ): array
2222 {
2323 $ method = $ node ->getMethodReflection ();
24- if ($ scope ->getPhpVersions ()->producesWarningForFinalPrivateMethods ()->no ()) {
24+ if ($ scope ->getPhpVersion ()->producesWarningForFinalPrivateMethods ()->no ()) {
2525 return [];
2626 }
2727
You can’t perform that action at this time.
0 commit comments