-
-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathrector.php
More file actions
71 lines (68 loc) · 2.86 KB
/
rector.php
File metadata and controls
71 lines (68 loc) · 2.86 KB
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
<?php
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector;
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\Config\RectorConfig;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector;
use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector;
use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Php85\Rector\FuncCall\ArrayKeyExistsNullToEmptyStringRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Tempest\Rector\ImportClassNamesRector;
return RectorConfig::configure()
->withCache('./.cache/rector', FileCacheStorage::class)
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/packages',
])
->withSkipPath(__DIR__ . '/tests/PHPStan/QueryFunctionDynamicReturnTypeExtension.php')
->withConfiguredRule(AddSensitiveParameterAttributeRector::class, [
'sensitive_parameters' => [
'password',
'secret',
],
])
->withSkip([
'*.stub.php',
'*.input.php',
'*.expected.php',
'*/Fixtures/*',
__DIR__ . '/packages/intl/bin/plural-rules.php',
AddOverrideAttributeToOverriddenMethodsRector::class,
ArrayToFirstClassCallableRector::class,
NullToStrictStringFuncCallArgRector::class,
ReadOnlyPropertyRector::class,
AddSensitiveParameterAttributeRector::class,
RestoreDefaultNullToNullableTypePropertyRector::class,
StaticCallOnNonStaticToInstanceCallRector::class,
EncapsedStringsToSprintfRector::class,
PrivatizeFinalClassMethodRector::class,
IssetOnPropertyObjectToPropertyExistsRector::class,
CatchExceptionNameMatchingTypeRector::class,
ArrayKeyExistsNullToEmptyStringRector::class,
StringClassNameToClassConstantRector::class,
ReturnBinaryOrToEarlyReturnRector::class,
])
->withConfiguredRule(ImportClassNamesRector::class, [
'importShortClasses' => true,
'excludedClasses' => [
'\Redis',
],
])
->withPreparedSets(
codeQuality: true,
codingStyle: true,
privatization: true,
naming: false,
earlyReturn: true,
)
->withPhpSets(php85: true);