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

[DeadCode] Remove RemoveDefaultArgumentValueRector #6148

Merged
merged 1 commit into from
Apr 15, 2021
Merged

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Apr 15, 2021

This rule is kind of opinionated - it actually decreases readability, as default variables can become explicit. It also more clear what happens if they're included, e.g.:

Strings::replace($content, '#find#');

vs

Strings::replace($content, '#find#', '');

In first example - what is going to happen?
In second example, we see the found pattern is replaced with empty string.

@TomasVotruba TomasVotruba changed the title remove def [DeadCode] Remove RemoveDefaultArgumentValueRector Apr 15, 2021
@samsonasik
Copy link
Member

I think we can unregister from the config set instead of remove the rule. By this, user that think it is usefull will still can use it. What do you think?

@TomasVotruba
Copy link
Member Author

Out in the wild most rules are used only as part of sets. Unless configurable and used on purpose.
We've had some feedback on dead-code being to strict, so I'm trying to clean it up a bit to be more available.

It can still be implemented & maintained by community though.

@TomasVotruba TomasVotruba merged commit 101041d into main Apr 15, 2021
@TomasVotruba TomasVotruba deleted the remove-def branch April 15, 2021 22:11
TomasVotruba added a commit that referenced this pull request Jul 15, 2024
rectorphp/rector-src@1e7fffd [Php55] Skip parse error on no concat in left in left Concat on PregReplaceEModifierRector (#6148)
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.

2 participants