From cb9cfcefcb82c86caab278adf30d108983b936fd Mon Sep 17 00:00:00 2001 From: Julien Waguet Date: Fri, 10 Oct 2025 14:38:37 +0200 Subject: [PATCH] Adds Rector for automated code refactoring Introduces Rector to automate code refactoring tasks and improve code quality. Includes a basic configuration file and adds Rector as a dependency. --- composer.json | 5 +++-- rector.php | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 rector.php diff --git a/composer.json b/composer.json index c691406..f2b34ec 100755 --- a/composer.json +++ b/composer.json @@ -35,7 +35,8 @@ "symfony/validator": "^5.2|^6.0", "phpstan/phpstan-symfony": "^1.0", "assoconnect/php-quality-config": "^1.10", - "symfony/security-core": "^5.0|^6.0" + "symfony/security-core": "^5.0|^6.0", + "rector/rector": "^1.2" }, "require": { "php": "^8.2", @@ -55,4 +56,4 @@ "dealerdirect/phpcodesniffer-composer-installer": true } } -} \ No newline at end of file +} diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..391f508 --- /dev/null +++ b/rector.php @@ -0,0 +1,17 @@ +withPaths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + // uncomment to reach your current PHP version + // ->withPhpSets() + ->withTypeCoverageLevel(0) + ->withSets([ + __DIR__ . '/vendor/assoconnect/php-quality-config/src/Rector/rules.php', + ]);