forked from temafey/micro-article-poc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
executable file
·81 lines (60 loc) · 2 KB
/
rector.php
File metadata and controls
executable file
·81 lines (60 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\ValueObject\PhpVersion;
/*
* Rector configuration for PHP 8.4 + Symfony 8.0 + DDD project.
*
* @see https://getrector.com/documentation
*/
return RectorConfig::configure()
// Paths to process
->withPaths([__DIR__ . '/src', __DIR__ . '/tests'])
// Skip paths that should not be refactored
->withSkip([
// Database migrations should not be modified
__DIR__ . '/src/Common/Infrastructure/Migrations',
// Cache and generated files
__DIR__ . '/var',
// Vendor dependencies
__DIR__ . '/vendor',
// Bootstrap files
__DIR__ . '/tests/bootstrap.php',
])
// PHP version targeting - use PHP 8.4 features
->withPhpSets(php84: true)
// Prepared rule sets for code quality
->withPreparedSets(
// Remove unused code
deadCode: true,
// Improve code quality
codeQuality: true,
// Consistent coding style
codingStyle: true,
// Add type declarations (return types, param types, property types)
typeDeclarations: true,
// Encapsulation improvements
privatization: true,
// Simplify conditionals with early returns
earlyReturn: true,
// PHPUnit test improvements
phpunitCodeQuality: true,
// Doctrine ORM improvements
doctrineCodeQuality: true,
// Symfony-specific improvements
symfonyCodeQuality: true,
)
// Additional sets for PHP 8.4 level
->withSets([LevelSetList::UP_TO_PHP_84])
// PHP version for analysis
->withPhpVersion(PhpVersion::PHP_84)
// Parallel processing for faster execution
->withParallel(timeoutSeconds: 360, maxNumberOfProcess: 16, jobSize: 20)
// Import short class names
->withImportNames(
importNames: true,
importDocBlockNames: true,
importShortClasses: true,
removeUnusedImports: true,
);