Skip to content

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

Merged
samsonasik merged 6 commits intomainfrom
keep-fqcn-conflict-ternary
Nov 16, 2023
Merged

[AutoImport][Php70] Keep FQCN on conflict last name on TernaryToNullCoalescingRector#5251
samsonasik merged 6 commits intomainfrom
keep-fqcn-conflict-ternary

Conversation

@samsonasik
Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

@samsonasik
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Finally fixed 🎉 /cc @staabm

@samsonasik
Copy link
Copy Markdown
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
@samsonasik samsonasik deleted the keep-fqcn-conflict-ternary branch November 16, 2023 03:02
@samsonasik
Copy link
Copy Markdown
Member Author

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

@staabm
Copy link
Copy Markdown
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
Copy Markdown
Contributor

staabm commented Nov 16, 2023

may I ask for another bugfix release? :)

@samsonasik
Copy link
Copy Markdown
Member Author

@samsonasik
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

Incorrect behavior of TernaryToNullCoalescingRector

2 participants