mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 14:03:41 +01:00
0dc28df936
8d92c466fd
[DX] Use RectorConfig in configs (#2063)
486 B
486 B
How To Configure Rules
Rector rules that implement Rector\Core\Contract\Rector\ConfigurableRectorInterface
can be configured.
Typical example is Rector\Renaming\Rector\Name\RenameClassRector
:
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
'App\SomeOldClass' => 'App\SomeNewClass',
]);
};