|
3 | 3 | use Rector\Core\Configuration\Option;
|
4 | 4 | use Rector\Core\ValueObject\PhpVersion;
|
5 | 5 | use Rector\Set\ValueObject\DowngradeSetList;
|
6 |
| -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
| 6 | +use Rector\Config\RectorConfig; |
7 | 7 |
|
8 | 8 | /** Define ABSPATH as this file's directory */
|
9 | 9 | if (!defined('ABSPATH')) {
|
10 | 10 | define('ABSPATH', __DIR__ . '/vendor/wordpress/wordpress/');
|
11 | 11 | }
|
12 | 12 |
|
13 |
| -return static function (ContainerConfigurator $containerConfigurator): void { |
| 13 | +return static function (RectorConfig $rectorConfig): void { |
14 | 14 | // get parameters
|
15 |
| - $parameters = $containerConfigurator->parameters(); |
| 15 | + $parameters = $rectorConfig->parameters(); |
16 | 16 |
|
17 | 17 | // paths to refactor; solid alternative to CLI arguments
|
18 |
| - $parameters->set(Option::PATHS, [ |
| 18 | + $rectorConfig->paths( [ |
19 | 19 | __DIR__ . '/src',
|
20 | 20 | __DIR__ . '/vendor_prefixed',
|
21 | 21 | __DIR__ . '/vendor/htmlburger/carbon-fields',
|
22 |
| - ]); |
| 22 | + ] ); |
23 | 23 |
|
24 |
| - $parameters->set(Option::SKIP, [ |
| 24 | + $rectorConfig->skip( [ |
25 | 25 | __DIR__ . '/src/_js',
|
26 | 26 | __DIR__ . '/src/_scss',
|
27 |
| - ]); |
| 27 | + ] ); |
28 | 28 |
|
29 | 29 | // Rector is static reflection to load code without running it - see https://phpstan.org/blog/zero-config-analysis-with-static-reflection
|
30 | 30 | $parameters->set(Option::AUTOLOAD_PATHS, [
|
|
43 | 43 | $parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, __DIR__ . '/phpstan.neon.dist');
|
44 | 44 |
|
45 | 45 | // here we can define, what sets of rules will be applied
|
46 |
| - $containerConfigurator->import( DowngradeSetList::PHP_80 ); |
47 |
| - $containerConfigurator->import( DowngradeSetList::PHP_74 ); |
48 |
| - $containerConfigurator->import( DowngradeSetList::PHP_73 ); |
49 |
| - $containerConfigurator->import( DowngradeSetList::PHP_72 ); |
| 46 | + $rectorConfig->import( DowngradeSetList::PHP_80 ); |
| 47 | + $rectorConfig->import( DowngradeSetList::PHP_74 ); |
| 48 | + $rectorConfig->import( DowngradeSetList::PHP_73 ); |
| 49 | + $rectorConfig->import( DowngradeSetList::PHP_72 ); |
50 | 50 | };
|
0 commit comments