@@ -124,9 +124,13 @@ public function handle()
124
124
125
125
protected function runPint ()
126
126
{
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
+ }
130
134
131
135
$ bin = tempnam (sys_get_temp_dir (), "pint " );
132
136
file_put_contents ($ bin , file_get_contents (base_path () . '/tools/pint ' ));
@@ -158,9 +162,13 @@ protected function runPint()
158
162
159
163
protected function runPHPCS ()
160
164
{
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
+ }
164
172
165
173
$ bin = tempnam (sys_get_temp_dir (), "phpcbf " );
166
174
file_put_contents ($ bin , file_get_contents (base_path () . '/tools/phpcbf ' ));
0 commit comments