Skip to content

Commit 0def268

Browse files
authored
Adds Rector for automated code refactoring (#36)
Introduces Rector to automate code improvements and standardization. This includes adding the rector/rector dependency and configuring Rector with predefined rulesets and paths for source and test files.
1 parent bb37ed5 commit 0def268

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
}
2323
},
2424
"require-dev": {
25-
"assoconnect/php-quality-config": "^1.12"
25+
"assoconnect/php-quality-config": "^1.12",
26+
"rector/rector": "^1.2"
2627
},
2728
"require": {
2829
"php": "^8.2",

rector.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
return RectorConfig::configure()
8+
->withPaths([
9+
__DIR__ . '/src',
10+
__DIR__ . '/tests',
11+
])
12+
// uncomment to reach your current PHP version
13+
// ->withPhpSets()
14+
->withTypeCoverageLevel(0)
15+
->withSets([
16+
__DIR__ . '/vendor/assoconnect/php-quality-config/src/Rector/rules.php',
17+
]);

0 commit comments

Comments
 (0)