mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
3442308bba
Co-authored-by: Marek Šimeček <marek.simecek@footshop.cz>
66 lines
2.2 KiB
PHP
66 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\CodingStyle\Rector\String_\SplitStringClassConstantToClassConstFetchRector;
|
|
use Rector\Core\Configuration\Option;
|
|
use Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector;
|
|
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
|
|
use Rector\Set\ValueObject\SetList;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$parameters = $containerConfigurator->parameters();
|
|
|
|
$parameters->set(Option::SETS, [
|
|
SetList::CODING_STYLE,
|
|
SetList::CODE_QUALITY,
|
|
SetList::DEAD_CODE,
|
|
SetList::NETTE_UTILS_CODE_QUALITY,
|
|
SetList::SOLID,
|
|
SetList::PRIVATIZATION,
|
|
SetList::NAMING,
|
|
SetList::ORDER,
|
|
SetList::DEFLUENT,
|
|
SetList::TYPE_DECLARATION,
|
|
SetList::PHPUNIT_CODE_QUALITY,
|
|
]);
|
|
|
|
$parameters->set(Option::PATHS, [
|
|
__DIR__ . '/src',
|
|
__DIR__ . '/rules',
|
|
__DIR__ . '/packages',
|
|
__DIR__ . '/tests',
|
|
__DIR__ . '/utils',
|
|
__DIR__ . '/compiler/src',
|
|
__DIR__ . '/compiler/bin/compile',
|
|
__DIR__ . '/compiler/build/scoper.inc.php',
|
|
__DIR__ . '/config/set',
|
|
]);
|
|
|
|
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
|
|
|
|
$parameters->set(Option::AUTOLOAD_PATHS, [__DIR__ . '/compiler/src']);
|
|
|
|
$parameters->set(Option::EXCLUDE_PATHS, [
|
|
'/Fixture/', '/Source/', '/Expected/',
|
|
__DIR__ . '/packages/doctrine-annotation-generated/src/*',
|
|
// tempalte files
|
|
__DIR__ . '/packages/rector-generator/templates/*',
|
|
// public api
|
|
__DIR__ . '/packages/rector-generator/src/ValueObject/RectorRecipe.php',
|
|
__DIR__ . '/rules/symfony-php-config/functions/functions.php',
|
|
]);
|
|
|
|
$parameters->set(Option::EXCLUDE_RECTORS, [
|
|
StringClassNameToClassConstantRector::class,
|
|
SplitStringClassConstantToClassConstFetchRector::class,
|
|
// false positives on constants used in rector-ci.php
|
|
RemoveUnusedClassConstantRector::class,
|
|
]);
|
|
|
|
# so Rector code is still PHP 7.2 compatible
|
|
$parameters->set(Option::PHP_VERSION_FEATURES, '7.2');
|
|
$parameters->set(Option::ENABLE_CACHE, true);
|
|
};
|