Updated rector config

This commit is contained in:
Jan Böhmer 2025-07-14 00:25:39 +02:00
parent ce86863095
commit 6665203f2a

View file

@ -16,6 +16,48 @@ use Rector\Symfony\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstan
use Rector\Symfony\Set\SymfonySetList;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
return RectorConfig::configure()
->withComposerBased(phpunit: true)
->withSymfonyContainerPhp(__DIR__ . '/tests/symfony-container.php')
->withSymfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml')
->withImportNames(importShortClasses: false)
->withPaths([
__DIR__ . '/config',
__DIR__ . '/public',
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withRules([
DeclareStrictTypesRector::class
])
->withSkip([
CountArrayToEmptyArrayComparisonRector::class,
//Leave our !== null checks alone
FlipTypeControlToUseExclusiveTypeRector::class,
//Leave our PartList TableAction alone
ActionSuffixRemoverRector::class,
//We declare event listeners via attributes, therefore no need to migrate them to subscribers
EventListenerToEventSubscriberRector::class,
PreferPHPUnitThisCallRector::class,
//Do not replace 'GET' with class constant,
LiteralGetToRequestClassConstantRector::class,
])
//Do not apply rules to Symfony own files
->withSkip([
__DIR__ . '/public/index.php',
__DIR__ . '/src/Kernel.php',
__DIR__ . '/config/preload.php',
__DIR__ . '/config/bundles.php',
])
;
/*
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml');
$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php');
@ -79,3 +121,4 @@ return static function (RectorConfig $rectorConfig): void {
__DIR__ . '/config/bundles.php',
]);
};
*/