# 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/277cad10-bafa-4d2a-b570-09b1a686de18 ```php <?php class CParent { public function __destruct() {} } class Child extends CParent { public function __destruct() {} } ``` ### Responsible rules * `AddReturnTypeDeclarationBasedOnParentClassMethodRector` ## Expected Behavior The rule suggest the following diff ```diff class Child extends CParent { - public function __destruct() + public function __destruct(): void {} } ``` Which is not valid: `__destruct() cannot declare a return type`