-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
64 lines (54 loc) · 2.09 KB
/
rector.php
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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
->withPhpVersion(PhpVersion::PHP_84)
->withPaths([
__DIR__ . '/src',
__DIR__ . '/config',
__DIR__ . '/tests/src',
__DIR__ . '/tests/config',
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
privatization: true,
instanceOf: true,
strictBooleans: true,
symfonyCodeQuality: true,
doctrineCodeQuality: true,
)
->withPhpSets(php81: true)
->withRules([
AddOverrideAttributeToOverriddenMethodsRector::class,
])
->withSkip([
// static analysis tools don't like this
RemoveNonExistingVarAnnotationRector::class,
// static analysis tools don't like this
RemoveUnusedVariableAssignRector::class,
// cognitive burden to many people
SimplifyIfElseToTernaryRector::class,
// potential cognitive burden
FlipTypeControlToUseExclusiveTypeRector::class,
// results in too long variables
CatchExceptionNameMatchingTypeRector::class,
// makes code unreadable
DisallowedShortTernaryRuleFixerRector::class,
// unsafe
SeparateMultiUseImportsRector::class,
// incorrectly removes empty final __construct()
RemoveEmptyClassMethodRector::class,
]);