Updated Rector to commit a775c65eeccc0c6ed106adbe836ab114f37c5da4

a775c65eec [CodeQuality] Skip throw after foreach with return in loop on SimplifyForeachToCoalescingRector (#5714)
This commit is contained in:
Tomas Votruba 2024-03-11 11:19:03 +00:00
parent 3e8c19254e
commit 4be56b3640
2 changed files with 6 additions and 5 deletions

View File

@ -88,15 +88,16 @@ CODE_SAMPLE
return null; return null;
} }
$nextStmt = $node->stmts[$key + 1] ?? null; $nextStmt = $node->stmts[$key + 1] ?? null;
if (!$nextStmt instanceof Return_) {
continue;
}
$return = $this->processForeachNodeWithReturnInside($foreach, $foreachReturnOrAssign, $nextStmt); $return = $this->processForeachNodeWithReturnInside($foreach, $foreachReturnOrAssign, $nextStmt);
if (!$return instanceof Return_) { if (!$return instanceof Return_) {
continue; continue;
} }
$node->stmts[$key] = $return; $node->stmts[$key] = $return;
// cleanup next return // cleanup next return
if ($nextStmt instanceof Return_) { unset($node->stmts[$key + 1]);
unset($node->stmts[$key + 1]);
}
$hasChanged = \true; $hasChanged = \true;
} }
} }

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = '01c460ee526f057b6a4d48835ac19536a857c347'; public const PACKAGE_VERSION = 'a775c65eeccc0c6ed106adbe836ab114f37c5da4';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2024-03-11 12:28:16'; public const RELEASE_DATE = '2024-03-11 18:16:44';
/** /**
* @var int * @var int
*/ */