-
Notifications
You must be signed in to change notification settings - Fork 25
/
rector.php
58 lines (51 loc) · 1.74 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector;
use Rector\CodingStyle\Rector\FuncCall\ConsistentImplodeRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
use Rector\Php54\Rector\Array_\LongArrayToShortArrayRector;
use Rector\Php80\Rector\Identical\StrEndsWithRector;
use Rector\Php80\Rector\Identical\StrStartsWithRector;
use Rector\Php80\Rector\NotIdentical\StrContainsRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php82\Rector\Encapsed\VariableInStringInterpolationFixerRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector;
return RectorConfig::configure()
->withPaths(
array(
__DIR__ . '/src',
__DIR__ . '/rewrite-rules-inspector.php',
)
)
->withSkip(
array(
LongArrayToShortArrayRector::class,
)
)
->withPhpSets( php74: true )
// Changes from later PHP Sets that are backwards compatible:
->withRules(
array(
// 8.0
ConsistentImplodeRector::class,
OptionalParametersAfterRequiredRector::class,
RemoveParentCallWithoutParentRector::class,
// Backfilled from PHP 8.0 into WP 5.9, so these can be used.
StrContainsRector::class,
StrEndsWithRector::class,
StrStartsWithRector::class,
// 8.1
NullToStrictStringFuncCallArgRector::class,
// 8.2
VariableInStringInterpolationFixerRector::class,
// 8.3
AddOverrideAttributeToOverriddenMethodsRector::class,
// 8.4
ExplicitNullableParamTypeRector::class,
)
)
->withPreparedSets( deadCode: true, codeQuality: true, instanceOf: true, codingStyle: true )
->withTypeCoverageLevel( 1 )
;