Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoImport][Php70] Keep FQCN on conflict last name on TernaryToNullCoalescingRector #5251

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik changed the title [AutoImport][Renaming] Keep FQCN on conflict last name on TernaryToNullCoalescingRector [AutoImport][Php70] Keep FQCN on conflict last name on TernaryToNullCoalescingRector Nov 15, 2023
@samsonasik
Copy link
Member Author

The issue seems only on no namespaced code, I added both namespaced and no namespaced fixture.

@samsonasik
Copy link
Member Author

@staabm the issue seems happen on static call:

Hersteller::getListForProducts(new \ProductFilter());

see https://getrector.com/demo/6129e6f8-3726-4d26-b961-306b42af6be6

when only use:

new \ProductFilter();

it seems working ok https://getrector.com/demo/813692b7-8f7a-49ea-9d55-fd1750e24573

so, the namespaced name somehow overlap under static call

@samsonasik
Copy link
Member Author

Finally fixed 🎉 /cc @staabm

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it to have faster feedback to test ;)

@samsonasik samsonasik merged commit 03de970 into main Nov 16, 2023
41 checks passed
@samsonasik samsonasik deleted the keep-fqcn-conflict-ternary branch November 16, 2023 03:02
@samsonasik
Copy link
Member Author

@staabm please try latest rector/rector:dev-main and verify if it working ok now :)

@staabm
Copy link
Contributor

staabm commented Nov 16, 2023

@samsonasik verified locally. looks great - I cannot reproduce the issue in our project anymore.

thank you

@staabm
Copy link
Contributor

staabm commented Nov 16, 2023

may I ask for another bugfix release? :)

@samsonasik
Copy link
Member Author

@samsonasik
Copy link
Member Author

@staabm this will cause another bug on renaming FQN-ize name from no-namespace to namespace while auto import, see

I will look into the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect behavior of TernaryToNullCoalescingRector
2 participants