Skip to content

Commit

Permalink
Updated Rector to commit 2b8cf93121045df5548684660ce7ae06b23b0e50
Browse files Browse the repository at this point in the history
rectorphp/rector-src@2b8cf93 [EarlyReturn] Skip nested with OR in root if statement condition on ChangeNestedForeachIfsToEarlyContinueRector (#6375)
  • Loading branch information
TomasVotruba committed Oct 11, 2024
1 parent d633e95 commit 24d2df8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '1fcd876367b12e6857552c593799d7f0eb0a8145';
public const PACKAGE_VERSION = '2b8cf93121045df5548684660ce7ae06b23b0e50';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-10-11 13:57:09';
public const RELEASE_DATE = '2024-10-11 22:10:47';
/**
* @var int
*/
Expand Down
4 changes: 4 additions & 0 deletions src/NodeManipulator/IfManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\BinaryOp\BooleanOr;
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
use PhpParser\Node\Expr\Exit_;
use PhpParser\Node\Expr\Variable;
Expand Down Expand Up @@ -124,6 +125,9 @@ public function collectNestedIfsWithNonBreaking(Foreach_ $foreach) : array
if (!$onlyForeachStmt instanceof If_) {
return [];
}
if ($onlyForeachStmt->cond instanceof BooleanOr) {
return [];
}
$ifs = [];
$currentIf = $onlyForeachStmt;
while ($this->isIfWithOnlyStmtIf($currentIf)) {
Expand Down

0 comments on commit 24d2df8

Please sign in to comment.