-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
59 lines (54 loc) · 2.31 KB
/
rector.php
File metadata and controls
59 lines (54 loc) · 2.31 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
<?php
declare(strict_types=1);
require_once 'vendor/autoload.php';
use Rector\CodeQuality\Rector\NullsafeMethodCall\CleanupUnneededNullsafeOperatorRector;
use Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Php80\Rector\Class_\StringableForToStringRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector;
use Rector\Php83\Rector\ClassConst\AddTypeToConstRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector;
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
use Rector\TypeDeclaration\Rector\Property\AddPropertyTypeDeclarationRector;
use Rector\TypeDeclaration\Rector\ClassMethod\{
AddMethodCallBasedStrictParamTypeRector,
AddParamTypeDeclarationRector,
AddParamTypeFromPropertyTypeRector,
AddVoidReturnTypeWhereNoReturnRector,
ParamTypeByMethodCallTypeRector,
ParamTypeByParentCallTypeRector,
ReturnNeverTypeRector,
ReturnUnionTypeRector
};
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src/Security'
])
->withSkip([
__DIR__ . '/src/Console/vendor'
])
->withPhpSets(php84: true)
->withRules([
AddVoidReturnTypeWhereNoReturnRector::class,
ArrayKeyExistsTernaryThenValueToCoalescingRector::class,
CleanupUnneededNullsafeOperatorRector::class,
RemoveUnusedVariableInCatchRector::class,
MixedTypeRector::class,
StringableForToStringRector::class,
AddSensitiveParameterAttributeRector::class,
AddTypeToConstRector::class,
AddOverrideAttributeToOverriddenMethodsRector::class,
AddMethodCallBasedStrictParamTypeRector::class,
AddParamTypeDeclarationRector::class,
AddParamTypeFromPropertyTypeRector::class,
AddPropertyTypeDeclarationRector::class,
EmptyOnNullableObjectToInstanceOfRector::class,
ParamTypeByMethodCallTypeRector::class,
ParamTypeByParentCallTypeRector::class,
ReturnNeverTypeRector::class,
ReturnUnionTypeRector::class,
ExplicitNullableParamTypeRector::class
]);