|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
5 | 5 | use Rector\Config\RectorConfig; |
6 | | -use Rector\Core\ValueObject\PhpVersion; |
7 | | -use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; |
8 | | -use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; |
9 | | -use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; |
10 | | -use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; |
11 | 6 | use Rector\Set\ValueObject\SetList; |
12 | | -use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector; |
13 | | -use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; |
14 | 7 |
|
15 | 8 | return static function (RectorConfig $rectorConfig): void { |
16 | 9 | $rectorConfig->paths([ |
17 | | - __DIR__ . '/src', |
18 | | - __DIR__ . '/test', |
| 10 | + __DIR__ . '/src', |
| 11 | + __DIR__ . '/test', |
| 12 | + __DIR__ . '/rector.php', |
19 | 13 | ]); |
20 | 14 |
|
21 | | - // Our base version of PHP. |
22 | | - $rectorConfig->phpVersion(PhpVersion::PHP_74); |
23 | | - |
24 | 15 | $rectorConfig->sets([ |
25 | | - SetList::PHP_82, |
| 16 | + SetList::PHP_74, |
26 | 17 | // Please no dead code or unneeded variables. |
27 | 18 | SetList::DEAD_CODE, |
28 | 19 | // Try to figure out type hints. |
29 | 20 | SetList::TYPE_DECLARATION, |
30 | 21 | ]); |
31 | 22 |
|
32 | | - $rectorConfig->skip([ |
33 | | - // Don't throw errors on JSON parse problems. Yet. |
34 | | - // @todo Throw errors and deal with them appropriately. |
35 | | - JsonThrowOnErrorRector::class, |
36 | | - // We like our tags. Please don't remove them. |
37 | | - RemoveUselessParamTagRector::class, |
38 | | - RemoveUselessReturnTagRector::class, |
39 | | - RemoveUselessVarTagRector::class, |
40 | | - ArrayShapeFromConstantArrayReturnRector::class, |
41 | | - AddMethodCallBasedStrictParamTypeRector::class, |
42 | | - ]); |
43 | | - |
| 23 | + $rectorConfig->removeUnusedImports(); |
44 | 24 | $rectorConfig->importNames(); |
45 | 25 | $rectorConfig->importShortClasses(false); |
46 | 26 | }; |
0 commit comments