mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
UPGRADE: add --set moving
This commit is contained in:
parent
b5e3933e75
commit
087972f8d0
@ -26,7 +26,7 @@ Sets with ambiguous naming were removed and rules moved to proper-named sets:
|
||||
};
|
||||
```
|
||||
|
||||
## `rector.php`
|
||||
## Single `SKIP` option `rector.php`
|
||||
|
||||
Since Rector 0.9 we switched from internal skipping to [`symplify/skipper` package](https://tomasvotruba.com/blog/2020/12/10/new-in-symplify-9-skipper-skipping-files-and-rules-made-simple/). Now there is only one `Option::SKIP` parameter to handle both paths and classes.
|
||||
|
||||
@ -80,3 +80,26 @@ Be sure to have **exactly 1** `Option::SKIP` in the end, as the Symfony paramete
|
||||
]);
|
||||
};
|
||||
```
|
||||
|
||||
## From CLI `--set`/`--level` to config
|
||||
|
||||
Rector now works more and more with set stacking. The number of sets is growing and IDE autocomplete helps to work with them effectively. If you use these options in CLI, move them to `rector.php` config like this:
|
||||
|
||||
```diff
|
||||
-vendor/bin/rector process src --set php80
|
||||
+vendor/bin/rector process src
|
||||
```
|
||||
|
||||
```diff
|
||||
use Rector\Core\Configuration\Option;
|
||||
+use Rector\Set\ValueObject\SetList;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$parameters = $containerConfigurator->parameters();
|
||||
|
||||
$parameters->set(Option::SETS, [
|
||||
+ SetList::PHP_80,
|
||||
]);
|
||||
};
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user