| Subject |
Details |
| PHP version |
any |
| Full Command |
vendor/bin/rector process /src --set dead-code |
Current Behaviour
Rector Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRector removes also private method, which should not be touched as it's done for purpose to not allow calls: new SomeClass().
- private function __construct()
- {
- }
-
public static function someMethod(): bool
{
Minimal PHP Code Causing Issue
<?php
class SomeClass
{
private function __construct()
{
}
public static function forExampleFactoryMethod()
{
return new self();
}
}
Expected Behaviour
No changes.
Current Behaviour
Rector
Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRectorremoves alsoprivatemethod, which should not be touched as it's done for purpose to not allow calls:new SomeClass().Minimal PHP Code Causing Issue
Expected Behaviour
No changes.