Skip to content

Commit 4be56b3

Browse files
committed
Updated Rector to commit a775c65eeccc0c6ed106adbe836ab114f37c5da4
rectorphp/rector-src@a775c65 [CodeQuality] Skip throw after foreach with return in loop on SimplifyForeachToCoalescingRector (#5714)
1 parent 3e8c192 commit 4be56b3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

rules/CodeQuality/Rector/Foreach_/SimplifyForeachToCoalescingRector.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,16 @@ public function refactor(Node $node) : ?Node
8888
return null;
8989
}
9090
$nextStmt = $node->stmts[$key + 1] ?? null;
91+
if (!$nextStmt instanceof Return_) {
92+
continue;
93+
}
9194
$return = $this->processForeachNodeWithReturnInside($foreach, $foreachReturnOrAssign, $nextStmt);
9295
if (!$return instanceof Return_) {
9396
continue;
9497
}
9598
$node->stmts[$key] = $return;
9699
// cleanup next return
97-
if ($nextStmt instanceof Return_) {
98-
unset($node->stmts[$key + 1]);
99-
}
100+
unset($node->stmts[$key + 1]);
100101
$hasChanged = \true;
101102
}
102103
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '01c460ee526f057b6a4d48835ac19536a857c347';
22+
public const PACKAGE_VERSION = 'a775c65eeccc0c6ed106adbe836ab114f37c5da4';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2024-03-11 12:28:16';
27+
public const RELEASE_DATE = '2024-03-11 18:16:44';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)