mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-20 06:38:46 +01:00
dfe158e2da
* [DX] Add TypeToStaticCall * [DX] Add ClassConstantRename * [DX] Add IssetUnsetToMethodCall * [DX] Add MethodToYield * drop unamtained shopware sets * [DX] Add RenamedAnnotationInType * [DX] Add MethodCallWrap * [DX] Add RenamedProperty * [DX] Add StringToClassConstant * [DX] Add ArgumentSwap * simplify rename function rector * [DX] Add RemovedFunctionArgument * [DX] Add MethodCallToService * [DX] Add UnprefixedMethodToGetSet * [DX] Add PseudoNamespaceToNamespaceRector * [DX] Add FunctionArgumentSwap * [DX] Add StaticCallToFunction * [DX] Add ParentCallToProperty * [DX] Add ParentDependency * [DX] Add CallWithParamRename * [DX] Added MethodCallRenameWithAddedArguments * [DX] Add PropertyToMethodCall * [DX] Add PropertyToMethodCall * [rector] [DX] Add PropertyToMethodCall * [cs] [DX] Add PropertyToMethodCall Co-authored-by: rector-bot <tomas@getrector.org>
45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\Core\Configuration\Option;
|
|
use Rector\Generic\ValueObject\NamespacePrefixWithExcludedClasses;
|
|
use Rector\SymfonyPhpConfig\Rector\ArrayItem\ReplaceArrayWithObjectRector;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
$services->set(ReplaceArrayWithObjectRector::class)
|
|
->call('configure', [[
|
|
ReplaceArrayWithObjectRector::CONSTANT_NAMES_TO_VALUE_OBJECTS => [
|
|
'Rector\Generic\Rector\Name\PseudoNamespaceToNamespaceRector::NAMESPACE_PREFIXES_WITH_EXCLUDED_CLASSES' => NamespacePrefixWithExcludedClasses::class,
|
|
],
|
|
]]);
|
|
|
|
$parameters = $containerConfigurator->parameters();
|
|
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
|
|
|
|
$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/*',
|
|
__DIR__ . '/packages/rector-generator/templates/*',
|
|
'*.php.inc',
|
|
]);
|
|
|
|
# so Rector code is still PHP 7.2 compatible
|
|
$parameters->set(Option::PHP_VERSION_FEATURES, '7.2');
|
|
};
|