File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,13 +107,22 @@ function runPhpCsFixer()
107107 $ returnCode = null ;
108108
109109 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 ' ,
111111 $ phpBin ,
112112 $ phpCsFixerBin ,
113113 implode (' ' , getFilesToFix ())
114114 ), $ output , $ returnCode );
115115
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 ;
117126}
118127
119128function runPhpstan ()
@@ -143,16 +152,10 @@ if ($phpSyntaxErrors) {
143152 exit (1 );
144153}
145154
146- $ phpCSFixerErrors = runPhpCsFixer ();
147- if ($ phpCSFixerErrors ) {
155+ $ phpCSFixed = runPhpCsFixer ();
156+ if ($ phpCSFixed ) {
148157 echo "Incorrect coding standards were detected and fixed. " . PHP_EOL ;
149158 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 ;
156159
157160 exit (1 );
158161}
@@ -167,4 +170,4 @@ if ($phpStanErrors) {
167170 exit (1 );
168171}
169172
170- exit (0 );
173+ exit (0 );
You can’t perform that action at this time.
0 commit comments