From 67a2d83196550c4d568b1aaa55ee4955ff66b952 Mon Sep 17 00:00:00 2001 From: Julien Waguet Date: Fri, 10 Oct 2025 13:45:05 +0200 Subject: [PATCH] Adds Rector for code quality and upgrades deps Adds Rector to automate code refactoring and improve code quality. Upgrades PHPUnit to the latest version and enables plugin installation for PHP_CodeSniffer via Composer. --- composer.json | 10 ++++++++-- rector.php | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 rector.php diff --git a/composer.json b/composer.json index d9893e4..0ce3ba8 100644 --- a/composer.json +++ b/composer.json @@ -42,10 +42,16 @@ "require-dev": { "doctrine/cache": "~1.0", "doctrine/annotations": "~1.0", - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^9.5", "symfony/framework-bundle": "^5.0|^6.0", "symfony/yaml": "^4.3|^5.0", "squizlabs/php_codesniffer": "^3.5", - "assoconnect/php-quality-config": "^1.11" + "assoconnect/php-quality-config": "^1.11", + "rector/rector": "^1.2" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } 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', + ]);