2020-07-18 20:26:57 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Rector\Core\Configuration\Option;
|
2020-08-26 12:54:53 +02:00
|
|
|
use Rector\Generic\ValueObject\NamespacePrefixWithExcludedClasses;
|
2020-08-25 00:26:14 +02:00
|
|
|
use Rector\SymfonyPhpConfig\Rector\ArrayItem\ReplaceArrayWithObjectRector;
|
2020-07-18 20:26:57 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
2020-08-25 00:26:14 +02:00
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$services->set(ReplaceArrayWithObjectRector::class)
|
|
|
|
->call('configure', [[
|
|
|
|
ReplaceArrayWithObjectRector::CONSTANT_NAMES_TO_VALUE_OBJECTS => [
|
2020-08-26 12:54:53 +02:00
|
|
|
'Rector\Generic\Rector\Name\PseudoNamespaceToNamespaceRector::NAMESPACE_PREFIXES_WITH_EXCLUDED_CLASSES' => NamespacePrefixWithExcludedClasses::class,
|
2020-08-25 00:26:14 +02:00
|
|
|
],
|
|
|
|
]]);
|
|
|
|
|
2020-07-18 20:26:57 +02:00
|
|
|
$parameters = $containerConfigurator->parameters();
|
|
|
|
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
|
2020-08-24 23:25:26 +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/*',
|
2020-07-30 01:39:41 +02:00
|
|
|
__DIR__ . '/packages/rector-generator/templates/*',
|
2020-07-27 11:26:41 +02:00
|
|
|
'*.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');
|
|
|
|
};
|