Skip to content

Commit 55165c0

Browse files
committed
Fix phpstan
1 parent c8b39ed commit 55165c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rules/DowngradePhp82/Rector/FuncCall/DowngradeIteratorCountToArrayRector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Rector\Rector\AbstractRector;
1818
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1919
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
20+
use Webmozart\Assert\Assert;
2021

2122
/**
2223
* @changelog https://www.php.net/manual/en/migration82.other-changes.php#migration82.other-changes.functions.spl
@@ -90,6 +91,8 @@ public function refactor(Node $node): ?Node
9091
return null;
9192
}
9293

94+
Assert::isInstanceOf($node->args[0], Arg::class);
95+
9396
$firstValue = $node->args[0]->value;
9497
$node->args[0]->value = new Ternary(
9598
$this->nodeFactory->createFuncCall('is_array', [new Arg($firstValue)]),

0 commit comments

Comments
 (0)