Skip to content

Commit eadb590

Browse files
authored
Update set usage in readme (#919)
* chore: update set usage in readme * fix link
1 parent 54ebd77 commit eadb590

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,29 @@ composer require rector/rector --dev
1414

1515
## Use Sets
1616

17-
To add a set to your config, use `Rector\Symfony\Set\SymfonySetList` class and pick one of constants:
17+
To add a set to your config, use `->withPreparedSets` method, and pick one :
1818

1919
```php
20+
use Rector\Config\RectorConfig;
21+
22+
return RectorConfig::configure()
23+
->withPreparedSets(symfonyCodeQuality: true)
24+
->withComposerBased(symfony: true);
25+
```
2026

27+
If you're on PHP 7.x, you can use withSets() instead, for `symfonyCodeQuality` set, so you can define:
28+
29+
```php
2130
use Rector\Config\RectorConfig;
2231
use Rector\Symfony\Set\SymfonySetList;
2332

2433
return RectorConfig::configure()
25-
->withSymfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml')
2634
->withSets([
27-
SymfonySetList::SYMFONY_62,
2835
SymfonySetList::SYMFONY_CODE_QUALITY,
29-
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
3036
]);
3137
```
3238

33-
<br>
39+
See [documentation](https://getrector.com/documentation/config-configuration#content-symfony-integration) for more.
3440

3541
## Configuration
3642

0 commit comments

Comments
 (0)