Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 486 Bytes

how_to_configure_rules.md

File metadata and controls

16 lines (12 loc) · 486 Bytes

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',
    ]);
};