2023-05-28 01:16:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
|
|
|
|
use Rector\Config\RectorConfig;
|
2023-05-28 01:33:45 +02:00
|
|
|
use Rector\Doctrine\Set\DoctrineSetList;
|
2023-05-28 01:16:12 +02:00
|
|
|
use Rector\Set\ValueObject\LevelSetList;
|
|
|
|
use Rector\Set\ValueObject\SetList;
|
|
|
|
use Rector\Symfony\Set\SymfonyLevelSetList;
|
|
|
|
use Rector\Symfony\Set\SymfonySetList;
|
|
|
|
|
|
|
|
return static function (RectorConfig $rectorConfig): void {
|
|
|
|
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml');
|
|
|
|
$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php');
|
|
|
|
|
2023-06-11 14:55:06 +02:00
|
|
|
//Import class names instead of using fully qualified class names
|
|
|
|
$rectorConfig->importNames();
|
|
|
|
//But keep the fully qualified class names for classes in the global namespace
|
|
|
|
$rectorConfig->importShortClasses(false);
|
|
|
|
|
2023-05-28 01:16:12 +02:00
|
|
|
$rectorConfig->paths([
|
|
|
|
__DIR__ . '/config',
|
|
|
|
__DIR__ . '/public',
|
|
|
|
__DIR__ . '/src',
|
|
|
|
__DIR__ . '/tests',
|
|
|
|
]);
|
|
|
|
|
|
|
|
// register a single rule
|
|
|
|
//$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
|
|
|
|
|
|
|
// define sets of rules
|
|
|
|
$rectorConfig->sets([
|
2023-05-28 01:33:45 +02:00
|
|
|
//PHP rules
|
2023-06-11 14:15:46 +02:00
|
|
|
SetList::CODE_QUALITY,
|
|
|
|
LevelSetList::UP_TO_PHP_81,
|
2023-05-28 01:33:45 +02:00
|
|
|
|
|
|
|
//Symfony rules
|
2023-05-28 01:16:12 +02:00
|
|
|
SymfonyLevelSetList::UP_TO_SYMFONY_62,
|
|
|
|
SymfonySetList::SYMFONY_CODE_QUALITY,
|
2023-05-28 01:33:45 +02:00
|
|
|
|
|
|
|
//Doctrine rules
|
|
|
|
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
|
|
|
|
DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
2023-05-28 01:16:12 +02:00
|
|
|
]);
|
|
|
|
};
|