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

[Php80] Keep numeric string as is on StringAnnotationToAttributeMapper #6608

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @Seldaek

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 72c537a into main Dec 18, 2024
41 checks passed
@samsonasik samsonasik deleted the keep-numeric-string-as-is branch December 18, 2024 11:22
@Seldaek
Copy link

Seldaek commented Dec 18, 2024

Thanks for the quick fix, are you sure this isn't gonna cause regressions like will it still treat 2 as int now? Maybe not but I wonder if all the other checks in that file make any sense then.

If you look at this https://getrector.com/demo/ae99daee-198a-4d2c-b948-d9788b3c25b2 - I also don't see why "true" gets turned into true.

Basically if something was a quoted string it should remain so as far as I can tell, not sure why all this magic in StringAnnotationToAttributeMapper was added in the first place.

@samsonasik
Copy link
Member Author

@Seldaek I see, special decorator seems needed for @TestWith to avoid regression, like doctrine decorator

if (! in_array($value->value, ['true', 'false'], true)) {

I will check

@samsonasik
Copy link
Member Author

I am going to revert it for now, the fix should be in a single PR to ease rollback.

@samsonasik
Copy link
Member Author

Reverted at #6609

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 TestWithAnnotationToAttributeRector with integers
2 participants