-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
90 lines (84 loc) · 4.15 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\ClassConst\SplitGroupedClassConstantsRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncArrayToVariadicRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector;
use Rector\CodingStyle\Rector\FuncCall\ConsistentImplodeRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\FuncCall\StrictArraySearchRector;
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
use Rector\CodingStyle\Rector\Property\SplitGroupedPropertiesRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector;
use Rector\DeadCode\Rector\BooleanAnd\RemoveAndTrueRector;
use Rector\DeadCode\Rector\Cast\RecastingRemovalRector;
use Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector;
use Rector\Php73\Rector\String_\SensitiveHereNowDocRector;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Rector\Strict\Rector\Ternary\BooleanInTernaryOperatorRuleFixerRector;
use Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$rectorConfig->sets([
SetList::PHP_52,
SetList::PHP_53,
SetList::PHP_54,
SetList::PHP_55,
SetList::PHP_56,
SetList::PHP_71,
SetList::PHP_72,
SetList::PHP_73,
SetList::PHP_74,
SetList::PHP_80,
SetList::PHP_81,
SetList::PHP_82,
SetList::PHP_83,
SetList::CODE_QUALITY,
]);
$rectorConfig->rule(ReadOnlyClassRector::class);
$rectorConfig->rule(BooleanInTernaryOperatorRuleFixerRector::class);
$rectorConfig->rule(DisallowedEmptyRuleFixerRector::class);
$rectorConfig->rule(DisallowedShortTernaryRuleFixerRector::class);
$rectorConfig->rule(CallUserFuncArrayToVariadicRector::class);
$rectorConfig->rule(CallUserFuncToMethodCallRector::class);
$rectorConfig->rule(ConsistentImplodeRector::class);
$rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class);
$rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class);
$rectorConfig->rule(NewlineAfterStatementRector::class);
$rectorConfig->rule(NewlineBeforeNewAssignSetRector::class);
$rectorConfig->rule(NullableCompareToNullRector::class);
$rectorConfig->rule(NullableCompareToNullRector::class);
$rectorConfig->rule(SeparateMultiUseImportsRector::class);
$rectorConfig->rule(SplitGroupedClassConstantsRector::class);
$rectorConfig->rule(SplitGroupedPropertiesRector::class);
$rectorConfig->rule(StaticArrowFunctionRector::class);
$rectorConfig->rule(StaticClosureRector::class);
$rectorConfig->rule(StrictArraySearchRector::class);
$rectorConfig->rule(StrictArraySearchRector::class);
$rectorConfig->rule(WrapEncapsedVariableInCurlyBracesRector::class);
$rectorConfig->rule(RecastingRemovalRector::class);
$rectorConfig->rule(RemoveAndTrueRector::class);
$rectorConfig->rule(RemoveAndTrueRector::class);
$rectorConfig->rule(RemoveNonExistingVarAnnotationRector::class);
$rectorConfig->rule(RemoveNonExistingVarAnnotationRector::class);
// no needed rules
$rectorConfig->skip([
SensitiveHereNowDocRector::class,
AddLiteralSeparatorToNumberRector::class,
ForRepeatedCountToOwnVariableRector::class,
LocallyCalledStaticMethodToNonStaticRector::class,
]);
};