|
5 | 5 | use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector; |
6 | 6 | use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; |
7 | 7 | use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; |
8 | | -use Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector; |
9 | | -use Rector\PHPUnit\Set\PHPUnitSetList; |
10 | | -use Rector\Set\ValueObject\LevelSetList; |
11 | 8 |
|
12 | | -return static function (RectorConfig $rectorConfig): void { |
13 | | - $rectorConfig->paths([ |
| 9 | +return RectorConfig::configure() |
| 10 | + ->withPaths([ |
14 | 11 | __DIR__ . '/examples', |
15 | 12 | __DIR__ . '/src', |
16 | 13 | __DIR__ . '/tests', |
17 | 14 | __DIR__ . '/tools', |
18 | | - ]); |
19 | | - |
20 | | - // Modernize code |
21 | | - $rectorConfig->sets([ |
22 | | - LevelSetList::UP_TO_PHP_74, |
23 | | - PHPUnitSetList::PHPUNIT_100, |
24 | | - ]); |
25 | | - |
26 | | - $rectorConfig->rule(ChangeSwitchToMatchRector::class); |
27 | | - $rectorConfig->rule(StaticDataProviderClassMethodRector::class); |
28 | | - |
| 15 | + ]) |
| 16 | + ->withPhpSets(php74: true) |
| 17 | + ->withComposerBased(phpunit: true) |
| 18 | + ->withRules([ |
| 19 | + ChangeSwitchToMatchRector::class, |
| 20 | + ]) |
| 21 | + // All classes are public API by default, unless marked with @internal. |
| 22 | + ->withConfiguredRule(RemoveAnnotationRector::class, ['api']) |
29 | 23 | // phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified |
30 | | - $rectorConfig->skip([ |
| 24 | + ->withSkip([ |
31 | 25 | RemoveExtraParametersRector::class, |
32 | 26 | // Do not use ternaries extensively |
33 | 27 | IfIssetToCoalescingRector::class, |
34 | 28 | ChangeSwitchToMatchRector::class => [ |
35 | 29 | __DIR__ . '/tests/SpecTests/Operation.php', |
36 | 30 | ], |
37 | | - ]); |
| 31 | + ]) |
38 | 32 | // phpcs:enable |
39 | | - |
40 | | - // All classes are public API by default, unless marked with @internal. |
41 | | - $rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['api']); |
42 | | -}; |
| 33 | + ->withImportNames(importNames: false, removeUnusedImports: true); |
0 commit comments