1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; |
||
6 | use Rector\Config\RectorConfig; |
||
7 | use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector; |
||
8 | use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector; |
||
9 | use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector; |
||
10 | use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector; |
||
11 | use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector; |
||
12 | use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector; |
||
13 | use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector; |
||
14 | use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector; |
||
15 | use Rector\DeadCode\Rector\Expression\RemoveDeadStmtRector; |
||
16 | use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector; |
||
17 | use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; |
||
18 | use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector; |
||
19 | use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; |
||
20 | use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; |
||
21 | use Rector\Php81\Rector\Array_\FirstClassCallableRector; |
||
22 | use Rector\Php81\Rector\ClassMethod\NewInInitializerRector; |
||
23 | use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; |
||
24 | use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitSelfCallRector; |
||
25 | use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector; |
||
26 | use Rector\PHPUnit\CodeQuality\Rector\MethodCall\AssertCountWithZeroToAssertEmptyRector; |
||
0 ignored issues
–
show
|
|||
27 | use Rector\TypeDeclaration\Rector\Closure\AddClosureNeverReturnTypeRector; |
||
28 | use Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector; |
||
29 | use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; |
||
30 | use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector; |
||
31 | |||
32 | return RectorConfig::configure() |
||
33 | ->withPaths([ |
||
34 | __DIR__ . '/src/*/src', |
||
35 | __DIR__ . '/src/*/*/src', |
||
36 | __DIR__ . '/src/*/*/tests', |
||
37 | __DIR__ . '/src/*/tests', |
||
38 | __DIR__ . '/tests', |
||
39 | ]) |
||
40 | ->withParallel() |
||
41 | ->withSkip([ |
||
42 | IfIssetToCoalescingRector::class, |
||
43 | RemoveUnusedPrivatePropertyRector::class => [ |
||
44 | __DIR__ . '/src/Scaffolder/src/Command/BootloaderCommand.php', |
||
45 | __DIR__ . '/src/Scaffolder/src/Command/CommandCommand.php', |
||
46 | __DIR__ . '/src/Scaffolder/src/Command/ConfigCommand.php', |
||
47 | __DIR__ . '/src/Scaffolder/src/Command/ControllerCommand.php', |
||
48 | __DIR__ . '/src/Scaffolder/src/Command/FilterCommand.php', |
||
49 | __DIR__ . '/src/Scaffolder/src/Command/JobHandlerCommand.php', |
||
50 | __DIR__ . '/src/Scaffolder/src/Command/MiddlewareCommand.php', |
||
51 | __DIR__ . '/src/Console/tests/PromptArgumentsTest.php', |
||
52 | ], |
||
53 | RemoveUnusedPrivateMethodRector::class => [ |
||
54 | __DIR__ . '/src/Boot/src/Bootloader/ConfigurationBootloader.php', |
||
55 | __DIR__ . '/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php', |
||
56 | __DIR__ . '/src/Cache/src/Bootloader/CacheBootloader.php', |
||
57 | __DIR__ . '/src/Serializer/src/Bootloader/SerializerBootloader.php', |
||
58 | __DIR__ . '/src/Validation/src/Bootloader/ValidationBootloader.php', |
||
59 | __DIR__ . '/src/Translator/tests/IndexerTest.php', |
||
60 | __DIR__ . '/src/Tokenizer/tests/ReflectionFileTest.php', |
||
61 | __DIR__ . '/src/Core/tests/SingletonsTest.php', |
||
62 | ], |
||
63 | RemoveUselessVarTagRector::class => [ |
||
64 | __DIR__ . '/src/Console/src/Traits/HelpersTrait.php', |
||
65 | ], |
||
66 | RemoveAlwaysTrueIfConditionRector::class => [ |
||
67 | __DIR__ . '/src/Boot/src/BootloadManager/Initializer.php', |
||
68 | __DIR__ . '/src/Stempler/src/Traverser.php', |
||
69 | __DIR__ . '/src/Prototype/src/NodeVisitors/LocateProperties.php', |
||
70 | __DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php', |
||
71 | __DIR__ . '/src/Logger/src/ListenerRegistry.php', |
||
72 | __DIR__ . '/src/Stempler/src/Transform/Merge/ExtendsParent.php', |
||
73 | __DIR__ . '/src/Bridge/Stempler/src/StemplerEngine.php', |
||
74 | ], |
||
75 | RemoveExtraParametersRector::class => [ |
||
76 | __DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php', |
||
77 | ], |
||
78 | RemoveUnusedPrivateMethodParameterRector::class => [ |
||
79 | __DIR__ . '/src/Core/src/Internal/Factory.php', |
||
80 | __DIR__ . '/src/Core/tests/InjectableTest.php', |
||
81 | ], |
||
82 | RemoveDoubleAssignRector::class => [ |
||
83 | __DIR__ . '/src/Core/tests/Scope/FinalizeAttributeTest.php', |
||
84 | ], |
||
85 | RemoveUnusedVariableAssignRector::class => [ |
||
86 | __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
||
87 | ], |
||
88 | RemoveDeadStmtRector::class => [ |
||
89 | __DIR__ . '/src/Core/tests/ExceptionsTest.php', |
||
90 | ], |
||
91 | |||
92 | // to be enabled later for bc break 4.x |
||
93 | RemoveUnusedPublicMethodParameterRector::class, |
||
94 | RemoveEmptyClassMethodRector::class, |
||
95 | RemoveUnusedPromotedPropertyRector::class, |
||
96 | NewInInitializerRector::class, |
||
97 | |||
98 | // start with short open tag |
||
99 | __DIR__ . '/src/Views/tests/fixtures/other/var.php', |
||
100 | __DIR__ . '/tests/app/views/native.php', |
||
101 | |||
102 | // example code for test |
||
103 | '*/Fixture/*', |
||
104 | '*/Fixtures/*', |
||
105 | '*/fixtures/*', |
||
106 | '*/Stub/*', |
||
107 | '*/Stubs/*', |
||
108 | '*/tests/Classes/*', |
||
109 | '*/tests/Internal/*', |
||
110 | __DIR__ . '/src/Console/tests/Configurator', |
||
111 | |||
112 | // cache |
||
113 | '*/runtime/cache/*', |
||
114 | |||
115 | ReadOnlyPropertyRector::class => [ |
||
116 | // used by Configurator |
||
117 | __DIR__ . '/src/Scaffolder/src/Command', |
||
118 | ], |
||
119 | |||
120 | FirstClassCallableRector::class => [ |
||
121 | __DIR__ . '/src/Core/tests/Scope/UseCaseTest.php', |
||
122 | ], |
||
123 | |||
124 | PreferPHPUnitThisCallRector::class, |
||
125 | |||
126 | MakeInheritedMethodVisibilitySameAsParentRector::class => [ |
||
127 | __DIR__ . '/src/Models/tests/PublicEntity.php', |
||
128 | ], |
||
129 | |||
130 | // Explicit behavior is more preferable |
||
131 | AssertCountWithZeroToAssertEmptyRector::class, |
||
132 | ]) |
||
133 | ->withPhpSets(php81: true) |
||
134 | ->withPreparedSets(deadCode: true, phpunitCodeQuality: true) |
||
135 | ->withComposerBased(phpunit: true) |
||
136 | ->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [ |
||
137 | ClassPropertyAssignToConstructorPromotionRector::RENAME_PROPERTY => false, |
||
138 | ]) |
||
139 | ->withTypeCoverageLevel(5) |
||
140 | ->withRules([ |
||
141 | ClosureReturnTypeRector::class, |
||
142 | TypedPropertyFromStrictSetUpRector::class, |
||
143 | PreferPHPUnitSelfCallRector::class, |
||
144 | TypedPropertyFromAssignsRector::class, |
||
145 | AddClosureNeverReturnTypeRector::class, |
||
146 | MakeInheritedMethodVisibilitySameAsParentRector::class, |
||
147 | ]); |
||
148 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths