-
-
Notifications
You must be signed in to change notification settings - Fork 87
/
rector.php
75 lines (72 loc) · 3.19 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
<?php
declare(strict_types=1);
use Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector;
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector;
use Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector;
use Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector;
use Rector\Php74\Rector\Ternary\ParenthesizeNestedTernaryRector;
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
use Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector;
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
return RectorConfig::configure()
->withCache('./.cache/rector', FileCacheStorage::class)
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withConfiguredRule(AddSensitiveParameterAttributeRector::class, [
'sensitive_parameters' => [
'password',
'secret',
],
])
->withRules([
ParenthesizeNestedTernaryRector::class,
ExplicitNullableParamTypeRector::class,
])
->withSkip([
AddOverrideAttributeToOverriddenMethodsRector::class,
ArgumentAdderRector::class,
ClosureToArrowFunctionRector::class,
EmptyOnNullableObjectToInstanceOfRector::class,
FirstClassCallableRector::class,
NullToStrictStringFuncCallArgRector::class,
ReadOnlyClassRector::class,
ReadOnlyPropertyRector::class,
RemoveNullPropertyInitializationRector::class,
AddSensitiveParameterAttributeRector::class,
RemoveUnusedPublicMethodParameterRector::class,
RestoreDefaultNullToNullableTypePropertyRector::class,
ReturnNeverTypeRector::class,
StaticCallOnNonStaticToInstanceCallRector::class,
ClosureReturnTypeRector::class,
EncapsedStringsToSprintfRector::class,
AddArrowFunctionReturnTypeRector::class,
])
->withSkipPath(__DIR__ .'/src/Tempest/Router/src/Exceptions/HttpProductionErrorHandler.php')
->withSkipPath(__DIR__ . '/src/Tempest/Router/src/Exceptions/exception.php')
->withParallel(300, 10, 10)
->withPreparedSets(
codeQuality: false,
codingStyle: true,
privatization: true,
naming: false,
earlyReturn: true,
)
->withDeadCodeLevel(40)
->withMemoryLimit('3G')
->withPhpSets(php83: true)
->withTypeCoverageLevel(37);