[DeadCode] Add RemoveUnusedPublicMethodParameterRector#5925
Merged
TomasVotruba merged 2 commits intomainfrom May 30, 2024
Merged
[DeadCode] Add RemoveUnusedPublicMethodParameterRector#5925TomasVotruba merged 2 commits intomainfrom
TomasVotruba merged 2 commits intomainfrom
Conversation
Member
Author
|
All checks have passed 🎉 @TomasVotruba I think it is ready. |
Member
|
I'm concerned about side effects of this rule. What happens if this method is still called with an extra parameter? $this->someMethod(1, 2);
public function someMethod($firstArg)
{
// ..
} |
Member
Author
|
There is a rule to remove extra argument already, and it already only remove last parameters, see https://getrector.com/demo/1918311b-dadd-4789-9381-55fb0e2e170e and when it is on middle, it will be skipped, see Of course, when named argument is used on the caller, and that's named arg no longer exist, it may cause invalid, but I think that need a different rule to handle :) |
Member
|
I see, lets ship this then :) |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add rule to remove unused parameter in public method on final class without extends and interface