-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.dist.php
74 lines (71 loc) · 3.47 KB
/
rector.dist.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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
use Rector\Removing\Rector\ClassMethod\ArgumentRemoverRector;
use Rector\ValueObject\PhpVersion;
use Rector\CodeQuality\Rector\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector;
use Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector;
use Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToCoalescingRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfNotNullReturnRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfNullableReturnRector;
use Rector\CodeQuality\Rector\FuncCall\SimplifyInArrayValuesRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector;
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
use Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
use Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withPhpVersion(PhpVersion::PHP_70)
->withImportNames(importShortClasses: false)
->withPhpSets(php70: true)
->withRules([
ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class,
ExplicitBoolCompareRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
ForRepeatedCountToOwnVariableRector::class,
InlineConstructorDefaultToPropertyRector::class,
ShortenElseIfRector::class,
SimplifyConditionsRector::class,
SimplifyDeMorganBinaryRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
SimplifyForeachToCoalescingRector::class,
SimplifyIfElseToTernaryRector::class,
SimplifyIfNotNullReturnRector::class,
SimplifyIfNullableReturnRector::class,
SimplifyInArrayValuesRector::class,
SimplifyUselessVariableRector::class,
TernaryEmptyArrayArrayDimFetchToCoalesceRector::class,
ThrowWithPreviousExceptionRector::class,
UseIdenticalOverEqualWithSameTypeRector::class,
CountArrayToEmptyArrayComparisonRector::class,
NullableCompareToNullRector::class,
SymplifyQuoteEscapeRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
PrivatizeFinalClassMethodRector::class,
PrivatizeFinalClassPropertyRector::class,
ArgumentRemoverRector::class
])
->withPreparedSets(
deadCode: true,
typeDeclarations: true,
instanceOf: true,
earlyReturn: true,
strictBooleans: true
);