docs: [4.4] fix Rector's incorrect refactoring - #7650
Merged
samsonasik merged 1 commit intoJul 6, 2023
Merged
Conversation
Member
|
could you create a simple reproducible bug on https://getrector.com/demo , it seems correct just by looking at it, but probably it prefilled/unset in other side that cause side effect on the property value. |
Member
Author
|
@samsonasik Created rectorphp/rector#8039 |
Member
|
@kenjis the |
kenjis
force-pushed
the
skip-rector-AutoRouterImproved
branch
from
July 6, 2023 04:25
60f82bf to
69f1aba
Compare
Member
Author
|
@samsonasik Thanks. I removed skipping |
Member
Author
|
The following error will be fixed by #7661 |
…tionRector
Without this doc type, Rector will refactor the following:
1) system/Router/AutoRouterImproved.php:294
---------- begin diff ----------
@@ @@
// Update the positions.
$this->methodPos = $this->paramPos;
- if ($params === []) {
- $this->paramPos = null;
- }
+ $this->paramPos = null;
if ($this->paramPos !== null) {
$this->paramPos++;
}
----------- end diff -----------
Applied rules:
* RemoveAlwaysTrueIfConditionRector
kenjis
force-pushed
the
skip-rector-AutoRouterImproved
branch
from
July 6, 2023 05:02
69f1aba to
ef1b3b2
Compare
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related #7649
The following refactoring will break the code.
Two tests will fail:
1) system/Router/AutoRouterImproved.php:294 ---------- begin diff ---------- @@ @@ // Update the positions. $this->methodPos = $this->paramPos; - if ($params === []) { - $this->paramPos = null; - } + $this->paramPos = null; if ($this->paramPos !== null) { $this->paramPos++; } ----------- end diff ----------- Applied rules: * RemoveAlwaysTrueIfConditionRectorhttps://github.com/codeigniter4/CodeIgniter4/actions/runs/5449192482/jobs/9913186865
Checklist: