Skip to content

Commit 3d183ca

Browse files
committed
Fix
1 parent 01b4404 commit 3d183ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rules/CodeQuality/Rector/MethodCall/AssertCountWithZeroToAssertEmptyRector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public function refactor(Node $node): MethodCall|StaticCall|null
7575
return null;
7676
}
7777

78+
$secondType = $this->getType($node->getArgs()[1]->value);
79+
if ($secondType instanceof UnionType) {
80+
return null;
81+
}
82+
7883
$value = ($type->getConstantScalarValues()[0] ?? null);
7984
if ($value === 0) {
8085
$args = $node->getArgs();

0 commit comments

Comments
 (0)