|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +declare(strict_types=1); |
| 4 | + |
3 | 5 | use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector; |
4 | 6 | use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector; |
5 | 7 | use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector; |
6 | | -use Rector\CodeQuality\Rector\For_\ForToForeachRector; |
7 | 8 | use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector; |
8 | | -use Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector; |
9 | 9 | use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector; |
10 | 10 | use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector; |
11 | 11 | use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector; |
|
21 | 21 | use Rector\Config\RectorConfig; |
22 | 22 | use Rector\Core\ValueObject\PhpVersion; |
23 | 23 | use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector; |
24 | | -use Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector; |
25 | 24 | use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector; |
26 | 25 | use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector; |
27 | 26 | use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector; |
28 | 27 | use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector; |
29 | 28 | use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; |
30 | | -use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector; |
31 | 29 | use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; |
32 | 30 | use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector; |
| 31 | +use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector; |
| 32 | +use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; |
33 | 33 | use Rector\PHPUnit\Set\PHPUnitSetList; |
34 | 34 | use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; |
35 | | -use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector; |
36 | 35 | use Rector\Set\ValueObject\LevelSetList; |
37 | 36 | use Rector\Set\ValueObject\SetList; |
38 | 37 | use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; |
|
41 | 40 | $rectorConfig->sets([ |
42 | 41 | SetList::DEAD_CODE, |
43 | 42 | LevelSetList::UP_TO_PHP_74, |
44 | | - PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD, |
| 43 | + PHPUnitSetList::PHPUNIT_CODE_QUALITY, |
45 | 44 | PHPUnitSetList::PHPUNIT_100, |
46 | 45 | ]); |
47 | 46 |
|
|
78 | 77 |
|
79 | 78 | JsonThrowOnErrorRector::class, |
80 | 79 | StringifyStrNeedlesRector::class, |
| 80 | + YieldDataProviderRector::class, |
81 | 81 |
|
82 | 82 | // Note: requires php 8 |
83 | 83 | RemoveUnusedPromotedPropertyRector::class, |
84 | | - |
85 | | - // Ignore tests that might make calls without a result |
86 | | - RemoveEmptyMethodCallRector::class => [ |
87 | | - __DIR__ . '/tests', |
88 | | - ], |
89 | | - |
90 | | - // Ignore files that should not be namespaced to their folder |
91 | | - NormalizeNamespaceByPSR4ComposerAutoloadRector::class => [ |
92 | | - __DIR__ . '/src/Helpers', |
93 | | - ], |
| 84 | + AnnotationWithValueToAttributeRector::class, |
94 | 85 |
|
95 | 86 | // May load view files directly when detecting classes |
96 | 87 | StringClassNameToClassConstantRector::class, |
97 | | - |
98 | | - // May be uninitialized on purpose |
99 | | - AddDefaultValueForUndefinedVariableRector::class, |
100 | 88 | ]); |
101 | 89 |
|
102 | 90 | // auto import fully qualified class names |
|
105 | 93 | $rectorConfig->rule(SimplifyUselessVariableRector::class); |
106 | 94 | $rectorConfig->rule(RemoveAlwaysElseRector::class); |
107 | 95 | $rectorConfig->rule(CountArrayToEmptyArrayComparisonRector::class); |
108 | | - $rectorConfig->rule(ForToForeachRector::class); |
109 | 96 | $rectorConfig->rule(ChangeNestedForeachIfsToEarlyContinueRector::class); |
110 | 97 | $rectorConfig->rule(ChangeIfElseValueAssignToEarlyReturnRector::class); |
111 | 98 | $rectorConfig->rule(SimplifyStrposLowerRector::class); |
|
118 | 105 | $rectorConfig->rule(UnusedForeachValueToArrayKeysRector::class); |
119 | 106 | $rectorConfig->rule(ChangeArrayPushToArrayAssignRector::class); |
120 | 107 | $rectorConfig->rule(UnnecessaryTernaryExpressionRector::class); |
121 | | - $rectorConfig->rule(AddPregQuoteDelimiterRector::class); |
122 | 108 | $rectorConfig->rule(SimplifyRegexPatternRector::class); |
123 | 109 | $rectorConfig->rule(FuncGetArgsToVariadicParamRector::class); |
124 | 110 | $rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class); |
125 | 111 | $rectorConfig->rule(SimplifyEmptyArrayCheckRector::class); |
126 | | - $rectorConfig->rule(NormalizeNamespaceByPSR4ComposerAutoloadRector::class); |
127 | 112 | $rectorConfig |
128 | 113 | ->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [ |
129 | 114 | /** |
|
0 commit comments