Skip to content

Commit 5b44784

Browse files
committed
[BCB] Remove TypeUtils::getAnyArrays()
1 parent 3bfe27e commit 5b44784

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

UPGRADING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Instead of `PHPStanTestCase::createBroker()`, call `PHPStanTestCase::createRefle
251251
* Removed methods from `ConstantArrayType` - `getFirst*Type` and `getLast*Type`
252252
* Use `getFirstIterable*Type` and `getLastIterable*Type` instead
253253
* Remove `ConstantArrayType::generalizeToArray()`
254-
* Remove `TypeUtils::getArrays()`, use [`Type::getArrays()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_getArrays) instead
254+
* Remove `TypeUtils::getArrays()` and `getAnyArrays()`, use [`Type::getArrays()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_getArrays) instead
255255
* Remove `TypeUtils::getConstantArrays()`, use [`Type::getConstantArrays()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_getConstantArrays) instead
256256
* Remove `TypeUtils::getConstantStrings()`, use [`Type::getConstantStrings()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_getConstantStrings) instead
257257
* Remove `TypeUtils::getConstantTypes()` and `getAnyConstantTypes()`, use [`Type::isConstantValue()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_isConstantValue) or [`Type::generalize()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_generalize)

src/Analyser/MutatingScope.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5251,11 +5251,11 @@ private static function generalizeType(Type $a, Type $b, int $depth): Type
52515251
private static function getArrayDepth(Type $type): int
52525252
{
52535253
$depth = 0;
5254-
$arrays = TypeUtils::getAnyArrays($type);
5254+
$arrays = TypeUtils::toBenevolentUnion($type)->getArrays();
52555255
while (count($arrays) > 0) {
52565256
$temp = $type->getIterableValueType();
52575257
$type = $temp;
5258-
$arrays = TypeUtils::getAnyArrays($type);
5258+
$arrays = TypeUtils::toBenevolentUnion($type)->getArrays();
52595259
$depth++;
52605260
}
52615261

src/Type/TypeUtils.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ public static function getConstantIntegers(Type $type): array
2828
return self::map(ConstantIntegerType::class, $type, false);
2929
}
3030

31-
/**
32-
* @return ArrayType[]
33-
*
34-
* @deprecated Use PHPStan\Type\Type::getArrays() instead.
35-
*/
36-
public static function getAnyArrays(Type $type): array
37-
{
38-
return self::map(ArrayType::class, $type, true, false);
39-
}
40-
4131
/**
4232
* @deprecated Use PHPStan\Type\Type::generalize() instead.
4333
*/

0 commit comments

Comments
 (0)