Skip to content

Commit

Permalink
Update README to use the new config syntax (#5674)
Browse files Browse the repository at this point in the history
* Update README to use the new config syntax

* use withPreparedSets

* Use withPreparedSets properly

* Remove unused use statement
  • Loading branch information
carlos-granados committed Mar 3, 2024
1 parent 1cd83be commit 1ae6844
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions build/target-repository/README.md
Expand Up @@ -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:
Expand Down

0 comments on commit 1ae6844

Please sign in to comment.