From 6665203f2aa19e53eb10510c82962cbd198a8e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 14 Jul 2025 00:25:39 +0200 Subject: [PATCH] Updated rector config --- rector.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/rector.php b/rector.php index 40eee9f7..d1e9edd5 100644 --- a/rector.php +++ b/rector.php @@ -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', ]); }; +*/