From 1ae68446ee021d88238f915bc06201559a0ec82d Mon Sep 17 00:00:00 2001 From: Carlos Granados Date: Sun, 3 Mar 2024 03:40:51 +0100 Subject: [PATCH] Update README to use the new config syntax (#5674) * Update README to use the new config syntax * use withPreparedSets * Use withPreparedSets properly * Remove unused use statement --- build/target-repository/README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/build/target-repository/README.md b/build/target-repository/README.md index 40bc46cacd9..4008c23e547 100644 --- a/build/target-repository/README.md +++ b/build/target-repository/README.md @@ -43,19 +43,18 @@ And modify it: ```php use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\SetList; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector; -return static function (RectorConfig $rectorConfig): void { +return RectorConfig::configure() // register single rule - $rectorConfig->rule(TypedPropertyFromStrictConstructorRector::class); - - // here we can define, what sets of rules will be applied - // tip: use "SetList" class to autocomplete sets with your IDE - $rectorConfig->sets([ - SetList::CODE_QUALITY - ]); -}; + ->withRules([ + TypedPropertyFromStrictConstructorRector::class + ]) + // here we can define, what prepared sets of rules will be applied + ->withPreparedSets( + deadCode: true, + codeQuality: true + ); ``` Then dry run Rector: