forked from PrestaShop/PrestaShop
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
Latest commit
103 lines (96 loc) · 4.8 KB
/
Copy pathrector.php
File metadata and controls
103 lines (96 loc) · 4.8 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
declare(strict_types=1);
usePrestaShopBundle\Security\Annotation\DemoRestricted;
useRector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
useRector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector;
useRector\Config\RectorConfig;
useRector\Php53\Rector\Ternary\TernaryToElvisRector;
useRector\Php55\Rector\Class_\ClassConstantToSelfClassRector;
useRector\Php55\Rector\String_\StringClassNameToClassConstantRector;
useRector\Php56\Rector\FuncCall\PowToExpRector;
useRector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
useRector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector;
useRector\Php70\Rector\If_\IfToSpaceshipRector;
useRector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector;
useRector\Php70\Rector\Ternary\TernaryToNullCoalescingRector;
useRector\Php71\Rector\FuncCall\CountOnNullRector;
useRector\Php71\Rector\TryCatch\MultiExceptionCatchRector;
useRector\Php72\Rector\FuncCall\GetClassOnNullRector;
useRector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
useRector\Php74\Rector\Assign\NullCoalescingOperatorRector;
useRector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
useRector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
useRector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
useRector\Php74\Rector\Ternary\ParenthesizeNestedTernaryRector;
useRector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
useRector\Php80\Rector\Class_\AnnotationToAttributeRector;
useRector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
useRector\Php80\Rector\Class_\StringableForToStringRector;
useRector\Php80\Rector\FunctionLike\MixedTypeRector;
useRector\Php80\Rector\FunctionLike\UnionTypesRector;
useRector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
useRector\Php80\Rector\Ternary\GetDebugTypeRector;
useRector\Php80\ValueObject\AnnotationToAttribute;
useRector\Php81\Rector\Array_\FirstClassCallableRector;
useRector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector;
useRector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
useRector\Php81\Rector\FunctionLike\IntersectionTypesRector;
useRector\Php81\Rector\Property\ReadOnlyPropertyRector;
useRector\Set\ValueObject\LevelSetList;
useRector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
useRector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
returnstaticfunction (RectorConfig$rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src/',
]);
$rectorConfig->sets(
[LevelSetList::UP_TO_PHP_81]
);
/**
* Ignored rules for now as grouping them would create a huge PR impossible to review,
* so I documented them here, I we can process them one by one.
*/
$rectorConfig->skip([
ReadOnlyPropertyRector::class => '*',
ClosureToArrowFunctionRector::class => '*',
InlineConstructorDefaultToPropertyRector::class => '*',
ClassPropertyAssignToConstructorPromotionRector::class => '*',
UnionTypesRector::class => '*',
MixedTypeRector::class => '*',
TypedPropertyFromAssignsRector::class => '*',
FinalizePublicClassConstantRector::class => '*',
CountOnNullRector::class => '*',
AddDefaultValueForUndefinedVariableRector::class => '*',
NullToStrictStringFuncCallArgRector::class => '*',
JsonThrowOnErrorRector::class => '*',
IntersectionTypesRector::class => '*',
ReturnNeverTypeRector::class => '*',
ChangeSwitchToMatchRector::class => '*',
TernaryToNullCoalescingRector::class => '*',
RemoveUnusedVariableInCatchRector::class => '*',
StringableForToStringRector::class => '*',
StringClassNameToClassConstantRector::class => '*',
IfToSpaceshipRector::class => '*',
FirstClassCallableRector::class => '*',
ExceptionHandlerTypehintRector::class => '*',
ThisCallOnStaticMethodToStaticCallRector::class => '*',
MultiExceptionCatchRector::class => '*',
TernaryToElvisRector::class => '*',
NullCoalescingOperatorRector::class => '*',
ArraySpreadInsteadOfArrayMergeRector::class => '*',
AddLiteralSeparatorToNumberRector::class => '*',
ParenthesizeNestedTernaryRector::class => '*',
GetDebugTypeRector::class => '*',
PowToExpRector::class => '*',
GetClassOnNullRector::class => '*',
ClassConstantToSelfClassRector::class => '*',
OptionalParametersAfterRequiredRector::class => '*',
]);
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [
newAnnotationToAttribute(DemoRestricted::class), ]
);
};