Remove constructor that only delegates call to parent class with same values
class Node
{
public function __construct(array $attributes)
{
}
}
class SomeParent extends Node
{
- public function __construct(array $attributes)
- {
- parent::__construct($attributes);
- }
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector;
return RectorConfig::configure()
->withRules([
RemoveParentDelegatingConstructorRector::class,
]);