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 e477635 commit 9a6a85bCopy full SHA for 9a6a85b
rules/DowngradePhp73/Rector/FuncCall/DowngradeArrayKeyFirstLastRector.php
@@ -216,12 +216,10 @@ private function refactorArrayKeyLast(
216
217
$resetExpression = new Expression($this->nodeFactory->createFuncCall('reset', [$array]));
218
219
- if (! $stmt instanceof StmtsAwareInterface && ! $stmt instanceof Return_) {
220
- $newStmts[] = new Expression($this->nodeFactory->createFuncCall('reset', [$array]));
221
- }
222
-
223
if ($stmt instanceof StmtsAwareInterface) {
224
$stmt->stmts = array_merge([$resetExpression], $stmt->stmts);
+ } elseif (! $stmt instanceof Return_) {
+ $newStmts[] = $resetExpression;
225
}
226
227
return $newStmts;
0 commit comments