Skip to content

Commit a720434

Browse files
committed
Updated Rector to commit b38a15657cfe101e1ead4eaeb977d263cb049bd5
rectorphp/rector-src@b38a156 [EarlyReturn] Only check on loop when initialAssign is set on PreparedValueToEarlyReturnRector (#6868)
1 parent de335b8 commit a720434

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rules/EarlyReturn/Rector/Return_/PreparedValueToEarlyReturnRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public function refactor(Node $node) : ?StmtsAwareInterface
104104
if ($stmt instanceof Expression && $stmt->expr instanceof AssignOp) {
105105
return null;
106106
}
107-
if ($stmt instanceof For_ || $stmt instanceof Foreach_ || $stmt instanceof While_ || $stmt instanceof Do_) {
108-
$isReassignInLoop = (bool) $this->betterNodeFinder->findFirst($stmt, fn(Node $node): bool => $node instanceof Assign && $this->nodeComparator->areNodesEqual($node->var, ($nullsafeVariable1 = $initialAssign) ? $nullsafeVariable1->var : null));
107+
if (($stmt instanceof For_ || $stmt instanceof Foreach_ || $stmt instanceof While_ || $stmt instanceof Do_) && $initialAssign instanceof Assign) {
108+
$isReassignInLoop = (bool) $this->betterNodeFinder->findFirst($stmt, fn(Node $node): bool => $node instanceof Assign && $this->nodeComparator->areNodesEqual($node->var, $initialAssign->var));
109109
if ($isReassignInLoop) {
110110
return null;
111111
}

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 = 'd025cdd0be230dcdad1510dbc73ce989623e868e';
22+
public const PACKAGE_VERSION = 'b38a15657cfe101e1ead4eaeb977d263cb049bd5';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-04-26 21:24:46';
27+
public const RELEASE_DATE = '2025-04-26 18:10:08';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)