|
2 | 2 |
|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
| 5 | +use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector; |
5 | 6 | use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; |
6 | 7 | use Rector\Config\RectorConfig; |
7 | | -use Rector\Set\ValueObject\DowngradeLevelSetList; |
8 | | -use Rector\Set\ValueObject\LevelSetList; |
| 8 | +use Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector; |
| 9 | +use Rector\ValueObject\PhpVersion; |
9 | 10 |
|
10 | | -return static function (RectorConfig $rectorConfig): void { |
11 | | - $rectorConfig->paths([ |
| 11 | +return RectorConfig::configure() |
| 12 | + ->withPaths([ |
12 | 13 | __DIR__ . '/src', |
13 | | - __DIR__ . '/tests/unit' |
| 14 | + __DIR__ . '/tests/unit', |
| 15 | + ]) |
| 16 | + ->withImportNames() |
| 17 | + ->withPhpVersion(PhpVersion::PHP_74) |
| 18 | + ->withPHPStanConfigs([ |
| 19 | + __DIR__ . '/phpstan.neon', |
| 20 | + ]) |
| 21 | + ->withRules([ |
| 22 | + InlineConstructorDefaultToPropertyRector::class, |
| 23 | + CompleteDynamicPropertiesRector::class, |
| 24 | + ClosureReturnTypeRector::class, |
14 | 25 | ]); |
15 | | - |
16 | | - // register a single rule |
17 | | - $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); |
18 | | - $rectorConfig->rule(Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class); |
19 | | - $rectorConfig->rule(Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector::class); |
20 | | - $rectorConfig->rule(Rector\PHPUnit\Rector\Class_\AddProphecyTraitRector::class); |
21 | | - $rectorConfig->importNames(); |
22 | | - |
23 | | - // define sets of rules |
24 | | - $rectorConfig->sets([ |
25 | | - DowngradeLevelSetList::DOWN_TO_PHP_73 |
26 | | - ]); |
27 | | -}; |
0 commit comments