Repository navigation
[DeadCode] Skip leading param removal when a docblock-only typed caller exists on RemoveUnusedPrivateMethodParameterRector - #9165
Merged
Conversation
…er exists on RemoveUnusedPrivateMethodParameterRector
TomasVotruba
force-pushed
the
fix-private-param-remover-leading-param
branch
from
December 4, 2026 09:57
2077587 to
b6668d6
Compare
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.
Since #9160, a call on a receiver typed only by docblock keeps its arguments. That is fine for trailing params, but removing a leading one shifts them:
became
mid($value)with$this->mid(2), while$doc->mid(1, 2)stayed - so$valuesilently receives1at runtime.Now when such a docblock-only typed caller exists, the method is skipped unless the removed params are trailing. Trailing removal (
keep_docblock_only_caller_args.php.inc) still works as before.