|
8 | 8 | use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector;
|
9 | 9 | use Rector\Php74\Rector\Property\TypedPropertyRector;
|
10 | 10 | use Rector\Set\ValueObject\LevelSetList;
|
| 11 | +use Rector\Set\ValueObject\SetList; |
11 | 12 | use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
|
12 |
| -use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector; |
13 |
| -use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector; |
14 | 13 | use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
|
15 |
| -use Rector\TypeDeclaration\Rector\Property\AddPropertyTypeDeclarationRector; |
16 | 14 |
|
17 |
| -return static function(RectorConfig $rectorConfig): void { |
18 |
| - $rectorConfig->paths([ |
| 15 | +return static function(RectorConfig $config): void { |
| 16 | + $config->paths([ |
19 | 17 | __DIR__ . '/src'
|
20 | 18 | ]);
|
21 | 19 |
|
22 |
| - // register a single rule |
23 |
| - $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); |
24 |
| - $rectorConfig->rule(NullCoalescingOperatorRector::class); |
25 |
| - $rectorConfig->rule(RemoveExtraParametersRector::class); |
26 |
| - |
27 |
| - $rectorConfig->rule(AddMethodCallBasedStrictParamTypeRector::class); |
28 |
| - $rectorConfig->rule(AddVoidReturnTypeWhereNoReturnRector::class); |
| 20 | + $config->import(SetList::DEAD_CODE); |
| 21 | + $config->import(SetList::TYPE_DECLARATION_STRICT); |
| 22 | + $config->import(SetList::TYPE_DECLARATION); |
| 23 | + $config->import(SetList::PHP_80); |
| 24 | + $config->import(SetList::PHP_74); |
| 25 | + $config->import(SetList::PHP_73); |
| 26 | + $config->import(SetList::EARLY_RETURN); |
| 27 | + $config->import(SetList::CODE_QUALITY); |
29 | 28 |
|
30 |
| - $rectorConfig->ruleWithConfiguration(TypedPropertyRector::class, [ |
31 |
| - TypedPropertyRector::INLINE_PUBLIC => true, |
32 |
| - ]); |
| 29 | + // register a single rule |
| 30 | + $config->rule(InlineConstructorDefaultToPropertyRector::class); |
| 31 | + $config->rule(RemoveExtraParametersRector::class); |
33 | 32 |
|
34 | 33 | // define sets of rules
|
35 |
| - $rectorConfig->sets([ |
| 34 | + $config->sets([ |
36 | 35 | LevelSetList::UP_TO_PHP_80
|
37 | 36 | ]);
|
38 | 37 |
|
39 |
| - $rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon'); |
| 38 | + $config->phpstanConfig(__DIR__ . '/phpstan.neon'); |
40 | 39 | };
|
0 commit comments