-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
False positive for UnusedPrivateMethod when method is called on clone #937
Comments
@sveneld thanks for your report, this is an interesting case. If this function is only used after the clone I should personal use the ps. I have edited your post to have the code highlighting working. |
Ok, I will try to create PR with failing test |
Basically the problem (using 2.12.0), by creating a new instance in a static method:
final class Test
{
public static function create(): self
{
$obj = new self();
$obj->doThing();
return $obj;
}
private function doThing(): void
{
}
} |
Current Behavior
phpmd: Avoid unused private methods such as 'prepareKeywords'.
Expected Behavior
No error
Steps To Reproduce:
Run phpmd inspection on provided code
The text was updated successfully, but these errors were encountered: