2020-07-18 20:26:57 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Rector\Core\Configuration\Option;
|
2020-07-30 00:43:06 +02:00
|
|
|
use Rector\Core\Contract\Rector\RectorInterface;
|
2020-07-20 14:18:15 +02:00
|
|
|
use Rector\Set\ValueObject\SetList;
|
2020-07-30 01:28:30 +02:00
|
|
|
use Rector\SymfonyPhpConfig\Rector\MethodCall\ChangeCallByNameToConstantByClassRector;
|
2020-07-18 20:26:57 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$containerConfigurator->import(__DIR__ . '/create-rector.php', null, 'not_found');
|
|
|
|
|
2020-07-30 00:43:06 +02:00
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
2020-07-30 01:28:30 +02:00
|
|
|
$services->set(ChangeCallByNameToConstantByClassRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [
|
|
|
|
[
|
2020-07-30 01:28:30 +02:00
|
|
|
ChangeCallByNameToConstantByClassRector::CLASS_TYPES_TO_METHOD_NAME => [
|
2020-07-30 00:43:06 +02:00
|
|
|
RectorInterface::class => 'configure',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
2020-07-18 20:26:57 +02:00
|
|
|
$parameters = $containerConfigurator->parameters();
|
|
|
|
|
|
|
|
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
|
|
|
|
|
2020-07-20 14:18:15 +02:00
|
|
|
$parameters->set(Option::SETS, [SetList::NAMING]);
|
2020-07-19 23:36:10 +02:00
|
|
|
|
2020-07-27 11:26:41 +02:00
|
|
|
$parameters->set(Option::PATHS, [
|
|
|
|
__DIR__ . '/src',
|
|
|
|
__DIR__ . '/tests',
|
|
|
|
__DIR__ . '/rules',
|
|
|
|
__DIR__ . '/utils',
|
|
|
|
__DIR__ . '/packages',
|
|
|
|
__DIR__ . '/bin/rector',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$parameters->set(Option::EXCLUDE_PATHS, [
|
|
|
|
'/Source/',
|
|
|
|
'/*Source/',
|
|
|
|
'/Fixture/',
|
|
|
|
'/Expected/',
|
|
|
|
__DIR__ . '/packages/doctrine-annotation-generated/src/*',
|
|
|
|
'*.php.inc',
|
|
|
|
]);
|
2020-07-18 20:26:57 +02:00
|
|
|
|
|
|
|
# so Rector code is still PHP 7.2 compatible
|
|
|
|
$parameters->set(Option::PHP_VERSION_FEATURES, '7.2');
|
|
|
|
};
|