@@ -124,9 +124,13 @@ public function handle()
124124
125125 protected function runPint ()
126126 {
127- $ configFile = tempnam (sys_get_temp_dir (), "pint " );
128- rename ($ configFile , $ configFile .= '.json ' );
129- file_put_contents ($ configFile , file_get_contents (base_path () . '/pint.json ' ));
127+ if (file_exists ('pint.json ' )) {
128+ $ configFile = 'pint.json ' ;
129+ } else {
130+ $ configFile = tempnam (sys_get_temp_dir (), "pint " );
131+ rename ($ configFile , $ configFile .= '.json ' );
132+ file_put_contents ($ configFile , file_get_contents (base_path () . '/pint.json ' ));
133+ }
130134
131135 $ bin = tempnam (sys_get_temp_dir (), "pint " );
132136 file_put_contents ($ bin , file_get_contents (base_path () . '/tools/pint ' ));
@@ -158,9 +162,13 @@ protected function runPint()
158162
159163 protected function runPHPCS ()
160164 {
161- $ configFile = tempnam (sys_get_temp_dir (), "phpcs " );
162- rename ($ configFile , $ configFile .= '.xml ' );
163- file_put_contents ($ configFile , file_get_contents (base_path () . '/.phpcs.xml ' ));
165+ if (file_exists ('.phpcs.xml ' )) {
166+ $ configFile = './.phpcs.xml ' ;
167+ } else {
168+ $ configFile = tempnam (sys_get_temp_dir (), "phpcs " );
169+ rename ($ configFile , $ configFile .= '.xml ' );
170+ file_put_contents ($ configFile , file_get_contents (base_path () . '/.phpcs.xml ' ));
171+ }
164172
165173 $ bin = tempnam (sys_get_temp_dir (), "phpcbf " );
166174 file_put_contents ($ bin , file_get_contents (base_path () . '/tools/phpcbf ' ));
0 commit comments