Skip to content

Commit 73e8fef

Browse files
committed
ensure pass assign
1 parent f376d3c commit 73e8fef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rules/DowngradePhp84/Rector/Expression/DowngradeArrayAllRector.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ public function getRuleDefinition(): RuleDefinition
7171
*/
7272
public function refactor(Node $node): ?array
7373
{
74+
if ($node instanceof Return_ && ! $node->expr instanceof FuncCall) {
75+
return null;
76+
}
77+
78+
if ($node instanceof Expression && ! $node->expr instanceof Assign) {
79+
return null;
80+
}
81+
7482
$expr = $node instanceof Expression && $node->expr instanceof Assign
7583
? $node->expr->expr
7684
: $node->expr;

0 commit comments

Comments
 (0)