Skip to content

Commit f46acaf

Browse files
committed
refactor new usages
1 parent 4d30cad commit f46acaf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Type/Php/ArrayCountValuesDynamicReturnTypeExtension.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PHPStan\Type\ArrayType;
1111
use PHPStan\Type\Constant\ConstantArrayType;
1212
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
13-
use PHPStan\Type\ErrorType;
1413
use PHPStan\Type\IntegerRangeType;
1514
use PHPStan\Type\Type;
1615
use PHPStan\Type\TypeCombinator;
@@ -49,11 +48,11 @@ public function getTypeFromFunctionCall(
4948

5049
if ($itemType instanceof UnionType) {
5150
$itemType = $itemType->filterTypes(
52-
static fn ($type) => !$type->toArrayKey() instanceof ErrorType,
51+
static fn ($type) => $type->toArrayKey()->isError()->no(),
5352
);
5453
}
5554

56-
if ($itemType->toArrayKey() instanceof ErrorType) {
55+
if (!$itemType->toArrayKey()->isError()->no()) {
5756
continue;
5857
}
5958

0 commit comments

Comments
 (0)