We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d30cad commit f46acafCopy full SHA for f46acaf
src/Type/Php/ArrayCountValuesDynamicReturnTypeExtension.php
@@ -10,7 +10,6 @@
10
use PHPStan\Type\ArrayType;
11
use PHPStan\Type\Constant\ConstantArrayType;
12
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
13
-use PHPStan\Type\ErrorType;
14
use PHPStan\Type\IntegerRangeType;
15
use PHPStan\Type\Type;
16
use PHPStan\Type\TypeCombinator;
@@ -49,11 +48,11 @@ public function getTypeFromFunctionCall(
49
48
50
if ($itemType instanceof UnionType) {
51
$itemType = $itemType->filterTypes(
52
- static fn ($type) => !$type->toArrayKey() instanceof ErrorType,
+ static fn ($type) => $type->toArrayKey()->isError()->no(),
53
);
54
}
55
56
- if ($itemType->toArrayKey() instanceof ErrorType) {
+ if (!$itemType->toArrayKey()->isError()->no()) {
57
continue;
58
59
0 commit comments