Skip to content

Commit e34e3bd

Browse files
authored
Merge pull request #7 from fsylum/update-readme-2024-04-29
Update README.md - 2024-04-29
2 parents c31ce6b + 8a98ba1 commit e34e3bd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,28 @@ composer require fsylum/rector-wordpress --dev
1212

1313
## Use Sets
1414

15-
To add a set to your config, use `Fsylum\RectorWordPress\Set\WordPressSetList` class and pick one of the constants:
15+
To add a set to your config, use `Fsylum\RectorWordPress\Set\WordPressSetList` class and pick one of the constants. For example, to update the codebase to WordPress 6.4, use `WordPressSetList::WP_6_4`.
1616

1717
```php
1818
use Fsylum\RectorWordPress\Set\WordPressSetList;
1919
use Rector\Config\RectorConfig;
2020

2121
return static function (RectorConfig $rectorConfig): void {
2222
$rectorConfig->sets([
23-
WordPressSetList::WP_6_4
23+
WordPressSetList::WP_6_4,
24+
]);
25+
};
26+
```
27+
28+
You can also use a level set list to include all the applicable rules from the lowest version, 0.71 up to the one you specified. For example, `WordPressLevelSetList::UP_TO_WP_6_4` will include all the rules from WordPress 0.71 up to 6.4. In most cases, this is the preferable way to transform your code as you only need to specify it once.
29+
30+
```php
31+
use Fsylum\RectorWordPress\Set\WordPressLevelSetList;
32+
use Rector\Config\RectorConfig;
33+
34+
return static function (RectorConfig $rectorConfig): void {
35+
$rectorConfig->sets([
36+
WordPressLevelSetList::UP_TO_WP_6_4,
2437
]);
2538
};
2639
```

0 commit comments

Comments
 (0)