We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See https://getrector.org/demo/ed9a3a77-ec36-4654-ad47-d8dd8f4c73ba
<?php final class DemoFile { public function run(): array { return array_map( static fn (string $bar): string => self::returnFoo(), ['bar'] ); } private static function returnFoo(): string { return 'foo'; } }
RemoveUnusedPrivateMethodRector
I would not expect the static method to be removed, but it is.
The text was updated successfully, but these errors were encountered:
It seems because it used in ArrowFunction, directly call seems not removed https://getrector.org/demo/87ee34dc-7bfd-4d09-9950-54e8f6a09e66
Sorry, something went wrong.
It seems caused by multiple rules applied, tried using only RemoveUnusedPrivateMethodRector seems working ok https://getrector.org/demo/a7f2f91c-f791-4585-a48b-5079059cb765
It seems due to combination rules:
Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector; Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector;
ref https://getrector.org/demo/66d03737-04b4-4345-89e5-074046ba496c
Successfully merging a pull request may close this issue.
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.org/demo/ed9a3a77-ec36-4654-ad47-d8dd8f4c73ba
Responsible rules
RemoveUnusedPrivateMethodRector
Expected Behavior
I would not expect the static method to be removed, but it is.
The text was updated successfully, but these errors were encountered: