From a6e74e2bd5846c6df5dd18b664ed09db892aa98c Mon Sep 17 00:00:00 2001 From: Julien Waguet Date: Fri, 10 Oct 2025 15:47:52 +0200 Subject: [PATCH] Adds Rector for automated code refactoring Enables Rector to automate code refactoring tasks. This commit introduces Rector, a tool for automated code refactoring, to the project. It adds Rector as a dependency and configures it to scan the source and test directories, using a predefined ruleset for code quality improvements. This helps maintain code consistency and modernize the codebase. --- composer.json | 3 ++- rector.php | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 rector.php diff --git a/composer.json b/composer.json index 8328af7..77f4b41 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,8 @@ "squizlabs/php_codesniffer": "^3", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1" + "phpstan/phpstan-strict-rules": "^1.1", + "rector/rector": "^1.2" }, "require": { "php": "^7.4|^8.0", 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', + ]);