|
2 | 2 |
|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
5 | | -use Rector\Core\Configuration\Option; |
| 5 | +use Rector\Config\RectorConfig; |
6 | 6 | use Rector\Core\ValueObject\PhpVersion; |
7 | 7 | use Rector\Set\ValueObject\LevelSetList; |
8 | | -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
9 | | - |
10 | | -return static function (ContainerConfigurator $containerConfigurator): void { |
11 | | - $parameters = $containerConfigurator->parameters(); |
12 | 8 |
|
| 9 | +return static function (RectorConfig $rectorConfig): void { |
13 | 10 | // paths to refactor; solid alternative to CLI arguments |
14 | | - $parameters->set(Option::PATHS, [ |
| 11 | + $rectorConfig->paths([ |
15 | 12 | __DIR__ . '/src', |
16 | 13 | __DIR__ . '/tests', |
17 | 14 | ]); |
18 | 15 |
|
19 | 16 | // Path to phpstan with extensions, that PHPSTan in Rector uses to determine types |
20 | | - $parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, __DIR__ . '/phpstan.neon'); |
| 17 | + $rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon'); |
21 | 18 |
|
22 | | - $parameters->set(Option::BOOTSTRAP_FILES, [ |
| 19 | + $rectorConfig->bootstrapFiles([ |
23 | 20 | __DIR__ . '/vendor/bin/.phpunit/phpunit/vendor/autoload.php', |
24 | 21 | __DIR__ . '/vendor/autoload.php', |
25 | 22 | ]); |
26 | 23 |
|
27 | 24 | // Define what rule sets will be applied |
28 | | - $containerConfigurator->import(LevelSetList::UP_TO_PHP_72); |
| 25 | + $rectorConfig->sets([ |
| 26 | + LevelSetList::UP_TO_PHP_72, |
| 27 | + ]); |
29 | 28 |
|
30 | 29 | // is your PHP version different from the one your refactor to? |
31 | | - $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_72); |
| 30 | + $rectorConfig->phpVersion(PhpVersion::PHP_72); |
32 | 31 | }; |
0 commit comments