File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -107,13 +107,22 @@ function runPhpCsFixer()
107
107
$ returnCode = null ;
108
108
109
109
exec (sprintf (
110
- '%s %s fix --config=.php_cs.php --no-interaction -v --path-mode=intersection -- %s ' ,
110
+ '%s %s fix --config=.php_cs.php --dry-run --no-interaction --path-mode=intersection -- %s ' ,
111
111
$ phpBin ,
112
112
$ phpCsFixerBin ,
113
113
implode (' ' , getFilesToFix ())
114
114
), $ output , $ returnCode );
115
115
116
- return $ returnCode ? $ output : false ;
116
+ if ($ returnCode ) {
117
+ exec (sprintf (
118
+ '%s %s fix --config=.php_cs.php --no-interaction -v --path-mode=intersection -- %s ' ,
119
+ $ phpBin ,
120
+ $ phpCsFixerBin ,
121
+ implode (' ' , getFilesToFix ())
122
+ ), $ output );
123
+ }
124
+
125
+ return $ returnCode ;
117
126
}
118
127
119
128
function runPhpstan ()
@@ -143,16 +152,10 @@ if ($phpSyntaxErrors) {
143
152
exit (1 );
144
153
}
145
154
146
- $ phpCSFixerErrors = runPhpCsFixer ();
147
- if ($ phpCSFixerErrors ) {
155
+ $ phpCSFixed = runPhpCsFixer ();
156
+ if ($ phpCSFixed ) {
148
157
echo "Incorrect coding standards were detected and fixed. " . PHP_EOL ;
149
158
echo "Please stash changes and run commit again. " . PHP_EOL ;
150
- echo "Output: " . PHP_EOL . PHP_EOL ;
151
-
152
- echo array_walk_recursive ($ phpStanErrors , function ($ item ) {
153
- echo $ item .PHP_EOL ;
154
- }) . PHP_EOL ;
155
- echo PHP_EOL ;
156
159
157
160
exit (1 );
158
161
}
@@ -167,4 +170,4 @@ if ($phpStanErrors) {
167
170
exit (1 );
168
171
}
169
172
170
- exit (0 );
173
+ exit (0 );
You can’t perform that action at this time.
0 commit comments