From 8d7085dc77487304fb54d1d4e29011dbd32bb490 Mon Sep 17 00:00:00 2001 From: Julien Waguet Date: Fri, 10 Oct 2025 13:57:58 +0200 Subject: [PATCH] Adds Rector for code quality and modernization Adds Rector PHP static analysis tool to improve code quality and automate code modernization. Includes initial Rector configuration with paths for `src` and `tests` directories and enables type coverage level check. --- 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 b8adc7d..2b150c6 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ } }, "require-dev": { - "assoconnect/php-quality-config": "^1.0" + "assoconnect/php-quality-config": "^1.0", + "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', + ]);