rector icon indicating copy to clipboard operation
rector copied to clipboard

Idea for automated fix

Open OskarStark opened this issue 1 year ago • 7 comments

Just found this in the Symfony codebase.

CleanShot 2024-09-19 at 08 01 17@2x

Not sure it is already done in PHPUNIT_QUALITY Set

OskarStark avatar Sep 19 '24 06:09 OskarStark

Thanks for sharing. How is useful to wide public? Could you share PR with change from Symfony?

TomasVotruba avatar Sep 19 '24 06:09 TomasVotruba

cc @alexandre-daubois

OskarStark avatar Sep 19 '24 08:09 OskarStark

It was detected here: https://github.com/symfony/symfony/pull/58303/files, along with some other errors. The most common in the PR is that expected and actual are reversed in some calls. I know this is a common error, this could be nice to have a Rector rule as well for this?

alexandre-daubois avatar Sep 19 '24 09:09 alexandre-daubois

I know this is a common error, this could be nice to have a Rector rule as well for this?

Not sure this can be detected

OskarStark avatar Sep 19 '24 09:09 OskarStark

It was detected by PHPStorm automated tool. I think you can detect this by checking if the actual parameter is a constant of any kind, and expected is variable

alexandre-daubois avatar Sep 19 '24 09:09 alexandre-daubois

Makes sense

OskarStark avatar Sep 19 '24 11:09 OskarStark

Alright then! Feel free to kick off PR 👍

rector-symfony repository seems like best target

TomasVotruba avatar Sep 19 '24 12:09 TomasVotruba

Closing as accepted to avoid keep issue tracker focus on unclear issues that needs our attention.

Feel free to send PR to https://github.com/rectorphp/rector-symfony with it :+1:

TomasVotruba avatar Mar 20 '25 09:03 TomasVotruba

This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.

github-actions[bot] avatar Dec 01 '25 03:12 github-actions[bot]