-
-
Notifications
You must be signed in to change notification settings - Fork 88
/
rector.php
112 lines (104 loc) · 4.96 KB
/
rector.php
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
104
105
106
107
108
109
110
111
112
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector;
use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector;
use Rector\DeadCode\Rector\Expression\RemoveDeadStmtRector;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\ClassMethod\NewInInitializerRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src/*/src',
__DIR__ . '/src/*/tests',
__DIR__ . '/tests',
])
->withParallel()
->withSkip([
IfIssetToCoalescingRector::class,
RemoveUnusedPrivatePropertyRector::class => [
__DIR__ . '/src/Scaffolder/src/Command/BootloaderCommand.php',
__DIR__ . '/src/Scaffolder/src/Command/CommandCommand.php',
__DIR__ . '/src/Scaffolder/src/Command/ConfigCommand.php',
__DIR__ . '/src/Scaffolder/src/Command/ControllerCommand.php',
__DIR__ . '/src/Scaffolder/src/Command/FilterCommand.php',
__DIR__ . '/src/Scaffolder/src/Command/JobHandlerCommand.php',
__DIR__ . '/src/Scaffolder/src/Command/MiddlewareCommand.php',
__DIR__ . '/src/Console/tests/PromptArgumentsTest.php',
],
RemoveUnusedPrivateMethodRector::class => [
__DIR__ . '/src/Boot/src/Bootloader/ConfigurationBootloader.php',
__DIR__ . '/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php',
__DIR__ . '/src/Cache/src/Bootloader/CacheBootloader.php',
__DIR__ . '/src/Serializer/src/Bootloader/SerializerBootloader.php',
__DIR__ . '/src/Validation/src/Bootloader/ValidationBootloader.php',
__DIR__ . '/src/Translator/tests/IndexerTest.php',
__DIR__ . '/src/Tokenizer/tests/ReflectionFileTest.php',
__DIR__ . '/src/Core/tests/SingletonsTest.php',
],
RemoveUselessVarTagRector::class => [
__DIR__ . '/src/Console/src/Traits/HelpersTrait.php',
],
RemoveAlwaysTrueIfConditionRector::class => [
__DIR__ . '/src/Boot/src/BootloadManager/Initializer.php',
__DIR__ . '/src/Stempler/src/Traverser.php',
__DIR__ . '/src/Prototype/src/NodeVisitors/LocateProperties.php',
__DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php',
__DIR__ . '/src/Logger/src/ListenerRegistry.php',
__DIR__ . '/src/Stempler/src/Transform/Merge/ExtendsParent.php',
],
RemoveExtraParametersRector::class => [
__DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php',
],
RemoveUnusedPrivateMethodParameterRector::class => [
__DIR__ . '/src/Core/src/Internal/Factory.php',
__DIR__ . '/src/Core/tests/InjectableTest.php',
],
RemoveDoubleAssignRector::class => [
__DIR__ . '/src/Core/tests/Scope/FinalizeAttributeTest.php',
],
RemoveUnusedVariableAssignRector::class => [
__DIR__ . '/src/Core/tests/ExceptionsTest.php',
],
RemoveDeadStmtRector::class => [
__DIR__ . '/src/Core/tests/ExceptionsTest.php',
],
// to be enabled later for bc break 4.x
RemoveUnusedPublicMethodParameterRector::class,
RemoveEmptyClassMethodRector::class,
RemoveUnusedPromotedPropertyRector::class,
NewInInitializerRector::class,
// start with short open tag
__DIR__ . '/src/Views/tests/fixtures/other/var.php',
__DIR__ . '/tests/app/views/native.php',
// example code for test
'*/Fixture/*',
'*/Fixtures/*',
'*/fixtures/*',
'*/Stub/*',
'*/Stubs/*',
'*/tests/Classes/*',
'*/tests/Internal/*',
__DIR__ . '/src/Console/tests/Configurator',
// cache
'*/runtime/cache/*',
ReadOnlyPropertyRector::class => [
// used by Configurator
__DIR__ . '/src/Scaffolder/src/Command',
],
])
->withPhpSets(php81: true)
->withPreparedSets(deadCode: true)
->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [
ClassPropertyAssignToConstructorPromotionRector::RENAME_PROPERTY => false,
]);