Skip to content

[EarlyReturn] Deprecate ChangeOrIfContinueToMultiContinueRector - #8299

Merged
TomasVotruba merged 1 commit into
mainfrom
deprecate-change-or-if-continue
Aug 5, 2026
Merged

[EarlyReturn] Deprecate ChangeOrIfContinueToMultiContinueRector#8299
TomasVotruba merged 1 commit into
mainfrom
deprecate-change-or-if-continue

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Deprecates ChangeOrIfContinueToMultiContinueRector and drops it from the early-return set.

Splitting a single || condition into multiple continue ifs makes the code longer and harder to follow in most cases - the reader has to mentally re-join the conditions that belong together.

The rule did this:

 foreach ($cars as $car) {
-    if ($car->hasWheels() || $car->hasFuel()) {
+    if ($car->hasWheels()) {
+        continue;
+    }
+    if ($car->hasFuel()) {
         continue;
     }

     $car->setWheel($newCar->wheel);
 }

The original single if is the more readable form, so the rule is deprecated instead of kept.

Splitting a single || condition into multiple continue ifs makes code
longer and harder to read in most cases. Removed from early-return set.
@TomasVotruba
TomasVotruba force-pushed the deprecate-change-or-if-continue branch from 5c85c0f to 4acfa67 Compare August 5, 2026 21:59
@TomasVotruba
TomasVotruba enabled auto-merge (squash) August 5, 2026 22:00
@TomasVotruba
TomasVotruba merged commit 3211d43 into main Aug 5, 2026
64 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-change-or-if-continue branch August 5, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant