Skip to content

Commit

Permalink
Merge pull request #7 from fsylum/update-readme-2024-04-29
Browse files Browse the repository at this point in the history
Update README.md - 2024-04-29
  • Loading branch information
fsylum authored Apr 29, 2024
2 parents c31ce6b + 8a98ba1 commit e34e3bd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,28 @@ composer require fsylum/rector-wordpress --dev

## Use Sets

To add a set to your config, use `Fsylum\RectorWordPress\Set\WordPressSetList` class and pick one of the constants:
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`.

```php
use Fsylum\RectorWordPress\Set\WordPressSetList;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
WordPressSetList::WP_6_4
WordPressSetList::WP_6_4,
]);
};
```

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.

```php
use Fsylum\RectorWordPress\Set\WordPressLevelSetList;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
WordPressLevelSetList::UP_TO_WP_6_4,
]);
};
```

0 comments on commit e34e3bd

Please sign in to comment.