-
Notifications
You must be signed in to change notification settings - Fork 3
/
rector.php
49 lines (46 loc) · 2.03 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPreparedSets(
codeQuality: true,
codingStyle: true,
strictBooleans: true,
// no privatization, naming, instanceOf, and earlyReturn
// no deadCode and typeDeclarations as they're below
)
->withAttributesSets(symfony: true, doctrine: true)
->withPhpSets()
->withTypeCoverageLevel(29)
->withDeadCodeLevel(40)
->withPaths([
__DIR__.'/src',
__DIR__.'/tests',
])
->withRootFiles()
->withSkip([
// don't remove useless variables inside AR events
// it's nice to keep them for editing later
Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class => [
__DIR__.'/src/Model/*/Event/*',
],
// we may not want the property to have a default value
Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector::class,
Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector::class,
// from set "codingStyle"
Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class,
Rector\CodingStyle\Rector\If_\NullableCompareToNullRector::class,
Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector::class,
Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector::class,
Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class,
// from set "strictBooleans"
Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector::class,
Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector::class,
// from set "codingStyle"
Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class,
Rector\CodeQuality\Rector\If_\CombineIfRector::class,
Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class,
// from set "deadCode"
Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class,
])
;