You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADING.md
+6
Original file line number
Diff line number
Diff line change
@@ -203,6 +203,12 @@ If you want to change `$overwrite` or `$rootExpr` (previous parameters also used
203
203
204
204
If you want to change `$overwrite` or `$rootExpr` (previous parameters also used to be accepted by the constructor), call `setAlwaysOverwriteTypes()` and `setRootExpr()`. These methods return a new object (SpecifiedTypes is immutable).
205
205
206
+
### `ConstantArrayType` no longer extends `ArrayType`
207
+
208
+
`Type::getArrays()` now returns `list<ArrayType|ConstantArrayType>`.
209
+
210
+
Using `$type instanceof ArrayType` is [being deprecated anyway](https://phpstan.org/blog/why-is-instanceof-type-wrong-and-getting-deprecated) so the impact of this change should be minimal.
This method now longer accepts `Expr $rootExpr`. If you want to change it, call `setRootExpr()` on [`SpecifiedTypes`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.SpecifiedTypes.html) (object returned by `TypeSpecifier::specifyTypesInCondition()`). `setRootExpr()` method returns a new object (SpecifiedTypes is immutable).
Copy file name to clipboardExpand all lines: phpstan-baseline.neon
+17-2
Original file line number
Diff line number
Diff line change
@@ -175,6 +175,11 @@ parameters:
175
175
count:1
176
176
path:src/PhpDoc/TypeNodeResolver.php
177
177
178
+
-
179
+
message:"#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
180
+
count:1
181
+
path:src/PhpDoc/TypeNodeResolver.php
182
+
178
183
-
179
184
message:"#^Doing instanceof PHPStan\\\\Type\\\\IterableType is error\\-prone and deprecated\\. Use Type\\:\\:isIterable\\(\\) instead\\.$#"
message:"#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
message:"#^Doing instanceof PHPStan\\\\Type\\\\IterableType is error\\-prone and deprecated\\. Use Type\\:\\:isIterable\\(\\) instead\\.$#"
510
520
count:1
@@ -657,7 +667,7 @@ parameters:
657
667
658
668
-
659
669
message:"#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
660
-
count:1
670
+
count:2
661
671
path:src/Type/ArrayType.php
662
672
663
673
-
@@ -1392,7 +1402,7 @@ parameters:
1392
1402
1393
1403
-
1394
1404
message:"#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
1395
-
count:10
1405
+
count:14
1396
1406
path:src/Type/TypeCombinator.php
1397
1407
1398
1408
-
@@ -1465,6 +1475,11 @@ parameters:
1465
1475
count:3
1466
1476
path:src/Type/TypehintHelper.php
1467
1477
1478
+
-
1479
+
message:"#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
1480
+
count:3
1481
+
path:src/Type/TypehintHelper.php
1482
+
1468
1483
-
1469
1484
message:"#^Doing instanceof PHPStan\\\\Type\\\\IterableType is error\\-prone and deprecated\\. Use Type\\:\\:isIterable\\(\\) instead\\.$#"
0 commit comments