# Bug Report <!-- First, thank you for reporting a bug. That takes time and we appreciate that! --> | Subject | Details | | :------------- | :--------------------| | Rector version | last dev-main | | Installed as | composer dependency | ## Minimal PHP Code Causing Issue See https://getrector.com/demo/2b8033af-2959-4d0e-9812-247b6573b363 ```php <?php trait DemoTrait { public function demoMethod() { $this->privateMethod(); } } final class DemoClass { use DemoTrait; private function privateMethod() { } } ``` ### Responsible rules * `RemoveUnusedPrivateMethodRector` ## Expected Behavior Do not delete a private method if it is called by a trait
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/2b8033af-2959-4d0e-9812-247b6573b363
Responsible rules
RemoveUnusedPrivateMethodRectorExpected Behavior
Do not delete a private method if it is called by a trait