Added tests for RenameVariableToMatchNewTypeRector #4898
Merged
TomasVotruba merged 6 commits intomasterfrom Dec 18, 2020
Merged
Added tests for RenameVariableToMatchNewTypeRector #4898TomasVotruba merged 6 commits intomasterfrom
TomasVotruba merged 6 commits intomasterfrom
Conversation
Contributor
Author
|
Changes to fix, applied by Rector Rectify, can be seen here: 182aef1 |
...ector/ClassMethod/RenameVariableToMatchNewTypeRector/Fixture/with_double_method_call.php.inc
Outdated
Show resolved
Hide resolved
Member
|
The test has probably different scope then real file. Is |
Contributor
Author
|
You were right, I got the wrong rule. The actual one is
I had kept the added test so long, to find out what was different. Now that I found out the problem, I made the test just minimal. |
Member
|
@leoloso Thank you 👍 |
Member
|
@samsonasik Could you check this one? It should be either skipped or better renamed with type suffix, like this: -$magicGet = $this->createClassConstFetch('SomeClass', 'MAGIC_GET');
+$magicGetClassConstFetch = $this->createClassConstFetch('SomeClass', 'MAGIC_GET');
-$magicSet = $this->createClassConstFetch('SomeClass', 'MAGIC_SET');
+$magicSetClassConstFetch = $this->createClassConstFetch('SomeClass', 'MAGIC_SET'); |
Member
|
I will try. |
simivar
approved these changes
Dec 18, 2020
Member
|
fixed. |
ef41f59 to
af945d0
Compare
Member
|
All checks have passed 🎉 @TomasVotruba it is ready for review. |
TomasVotruba
approved these changes
Dec 18, 2020
Member
|
Thank you |
TomasVotruba
added a commit
that referenced
this pull request
Sep 2, 2023
rectorphp/rector-src@3243e0e Add number support to concat EncapsedStringsToSprintfRector (#4898)
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.
As requested in #4879 (comment)
However, the tests are not failing in the expected manner:
with_method_call.php.incshould not fail, but it doeswith_double_method_call.php.increplicates the issue from Rector Rectify. It fails, but it a different way than expected:$flagwas not renamed as$bitwiseOr, and$magicGetwas left intactAm I missing something?