|
11 | 11 | * file that was distributed with this source code.
|
12 | 12 | */
|
13 | 13 |
|
14 |
| -use Rector\Core\Configuration\Option; |
15 |
| -use Rector\Php74\Rector\Property\TypedPropertyRector; |
| 14 | +use Rector\Config\RectorConfig; |
16 | 15 | use Rector\Set\ValueObject\LevelSetList;
|
17 | 16 | use Rector\Set\ValueObject\SetList;
|
18 |
| -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
19 | 17 |
|
20 |
| -return static function (ContainerConfigurator $containerConfigurator): void { |
21 |
| - // get parameters |
22 |
| - $parameters = $containerConfigurator->parameters(); |
23 |
| - $parameters->set(Option::PATHS, [ |
| 18 | +return static function (RectorConfig $rectorConfig): void { |
| 19 | + $rectorConfig->paths([ |
24 | 20 | __DIR__ . '/src',
|
25 | 21 | __DIR__ . '/tests',
|
26 | 22 | ]);
|
27 | 23 |
|
28 |
| - $parameters->set(Option::BOOTSTRAP_FILES, [ |
| 24 | + $rectorConfig->bootstrapFiles([ |
29 | 25 | __DIR__ . '/vendor/autoload.php',
|
30 | 26 | __DIR__ . '/tools/phpunit/vendor/autoload.php',
|
31 | 27 | ]);
|
32 | 28 |
|
33 | 29 | // Define what rule sets will be applied
|
34 |
| - $containerConfigurator->import(LevelSetList::UP_TO_PHP_74); |
35 |
| - $containerConfigurator->import(SetList::CODE_QUALITY); |
36 |
| - $containerConfigurator->import(SetList::CODING_STYLE); |
37 |
| - $containerConfigurator->import(SetList::DEAD_CODE); |
38 |
| - $containerConfigurator->import(SetList::NAMING); |
39 |
| - $containerConfigurator->import(SetList::PRIVATIZATION); |
40 |
| - $containerConfigurator->import(SetList::PSR_4); |
41 |
| - $containerConfigurator->import(SetList::TYPE_DECLARATION); |
42 |
| - $containerConfigurator->import(SetList::TYPE_DECLARATION_STRICT); |
43 |
| - $containerConfigurator->import(SetList::UNWRAP_COMPAT); |
44 |
| - $containerConfigurator->import(SetList::EARLY_RETURN); |
45 |
| - |
46 |
| - // get services (needed for register a single rule) |
47 |
| - // $services = $containerConfigurator->services(); |
48 |
| - |
49 |
| - // register a single rule |
50 |
| - // $services->set(TypedPropertyRector::class); |
| 30 | + $rectorConfig->import(LevelSetList::UP_TO_PHP_74); |
| 31 | + $rectorConfig->import(SetList::CODE_QUALITY); |
| 32 | + $rectorConfig->import(SetList::CODING_STYLE); |
| 33 | + $rectorConfig->import(SetList::DEAD_CODE); |
| 34 | + $rectorConfig->import(SetList::NAMING); |
| 35 | + $rectorConfig->import(SetList::PRIVATIZATION); |
| 36 | + $rectorConfig->import(SetList::PSR_4); |
| 37 | + $rectorConfig->import(SetList::TYPE_DECLARATION); |
| 38 | + $rectorConfig->import(SetList::TYPE_DECLARATION_STRICT); |
| 39 | + $rectorConfig->import(SetList::UNWRAP_COMPAT); |
| 40 | + $rectorConfig->import(SetList::EARLY_RETURN); |
51 | 41 | };
|
0 commit comments