Skip to content

Commit 0975574

Browse files
committed
Rector: Upgrade configuration
1 parent 9ed89bd commit 0975574

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

rector.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,30 @@
22

33
declare(strict_types=1);
44

5-
use Rector\Core\Configuration\Option;
5+
use Rector\Config\RectorConfig;
66
use Rector\Core\ValueObject\PhpVersion;
77
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();
128

9+
return static function (RectorConfig $rectorConfig): void {
1310
// paths to refactor; solid alternative to CLI arguments
14-
$parameters->set(Option::PATHS, [
11+
$rectorConfig->paths([
1512
__DIR__ . '/src',
1613
__DIR__ . '/tests',
1714
]);
1815

1916
// 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');
2118

22-
$parameters->set(Option::BOOTSTRAP_FILES, [
19+
$rectorConfig->bootstrapFiles([
2320
__DIR__ . '/vendor/bin/.phpunit/phpunit/vendor/autoload.php',
2421
__DIR__ . '/vendor/autoload.php',
2522
]);
2623

2724
// 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+
]);
2928

3029
// 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);
3231
};

0 commit comments

Comments
 (0)