File tree 3 files changed +53
-3
lines changed
3 files changed +53
-3
lines changed Original file line number Diff line number Diff line change 73
73
74
74
- name : Run mess detector
75
75
run : composer phpmd
76
+
77
+ rector :
78
+ runs-on : ubuntu-latest
79
+ name : Rector
80
+
81
+ steps :
82
+ - name : Checkout code
83
+ uses : actions/checkout@v4
84
+
85
+ - name : Setup
86
+ uses : ./.github/actions/setup
87
+ with :
88
+ php_version : 8.3
89
+ laravel_version : 11
90
+
91
+ - name : Run mess detector
92
+ run : composer rector
Original file line number Diff line number Diff line change 71
71
"orchestra/testbench" : " ^8.0|^9.0" ,
72
72
"phpmd/phpmd" : " ^2.15" ,
73
73
"phpunit/phpunit" : " ^10.0|^11.0" ,
74
+ "rector/rector" : " ^1.2" ,
74
75
"squizlabs/php_codesniffer" : " ^3.10"
75
76
},
76
77
"suggest" : {
85
86
"scripts" : {
86
87
"standards:check" : [
87
88
" @phpcs" ,
88
- " @phpmd"
89
+ " @phpmd" ,
90
+ " @rector"
89
91
],
90
92
"standards:fix" : [
91
- " @phpcs:fix"
93
+ " @phpcs:fix" ,
94
+ " @rector:fix"
92
95
],
93
96
"test" : " phpunit" ,
94
97
"phpcs" : " ./vendor/bin/phpcs --standard=PSR12 --ignore=vendor ." ,
95
98
"phpcs:fix" : " ./vendor/bin/phpcbf --standard=PSR12 --ignore=vendor ." ,
96
- "phpmd" : " ./vendor/bin/phpmd . github .phpmd/ruleset.xml --color"
99
+ "phpmd" : " ./vendor/bin/phpmd . github .phpmd/ruleset.xml --color" ,
100
+ "rector" : " ./vendor/bin/rector process --dry-run" ,
101
+ "rector:fix" : " ./vendor/bin/rector process"
97
102
}
98
103
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Rector \CodeQuality \Rector \Concat \JoinStringConcatRector ;
4
+ use Rector \CodeQuality \Rector \Empty_ \SimplifyEmptyCheckOnEmptyArrayRector ;
5
+ use Rector \Config \RectorConfig ;
6
+ use Rector \Php83 \Rector \ClassMethod \AddOverrideAttributeToOverriddenMethodsRector ;
7
+ use Rector \Strict \Rector \Empty_ \DisallowedEmptyRuleFixerRector ;
8
+
9
+ return RectorConfig::configure ()
10
+ ->withPaths ([
11
+ __DIR__ . '/ ' ,
12
+ ])
13
+ ->withSkip ([
14
+ __DIR__ . '/vendor ' ,
15
+ ])
16
+ ->withSkip ([
17
+ AddOverrideAttributeToOverriddenMethodsRector::class,
18
+ JoinStringConcatRector::class,
19
+ SimplifyEmptyCheckOnEmptyArrayRector::class,
20
+ DisallowedEmptyRuleFixerRector::class
21
+ ])
22
+ ->withPhpSets ()
23
+ ->withPreparedSets (
24
+ true ,
25
+ true ,
26
+ false ,
27
+ true
28
+ );
You can’t perform that action at this time.
0 commit comments