You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.3 KiB
36 lines
1.3 KiB
<?php |
|
|
|
declare(strict_types=1); |
|
|
|
use Rector\Core\Configuration\Option; |
|
use Rector\Core\ValueObject\PhpVersion; |
|
use Rector\PHPUnit\Set\PHPUnitSetList; |
|
use Rector\Set\ValueObject\LevelSetList; |
|
use Rector\Set\ValueObject\SetList; |
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void { |
|
$parameters = $containerConfigurator->parameters(); |
|
|
|
// paths to refactor; solid alternative to CLI arguments |
|
$parameters->set(Option::PATHS, [ |
|
__DIR__ . '/src', |
|
__DIR__ . '/tests', |
|
]); |
|
|
|
// Path to phpstan with extensions, that PHPSTan in Rector uses to determine types |
|
$parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, __DIR__ . '/phpstan.neon'); |
|
|
|
$parameters->set(Option::BOOTSTRAP_FILES, [ |
|
__DIR__ . '/vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php', |
|
__DIR__ . '/vendor/autoload.php', |
|
]); |
|
|
|
// Define what rule sets will be applied |
|
$containerConfigurator->import(LevelSetList::UP_TO_PHP_72); |
|
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_80); |
|
$containerConfigurator->import(SetList::CODE_QUALITY); |
|
|
|
// is your PHP version different from the one your refactor to? |
|
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_72); |
|
};
|
|
|