Skip to content

Commit

Permalink
Update core
Browse files Browse the repository at this point in the history
- Defer the loading of provider.
- Use realpath for the config argument.
  • Loading branch information
JackieDo committed Jun 15, 2020
1 parent 67629ff commit d643fc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ArtisanPhpCsFixerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ArtisanPhpCsFixerServiceProvider extends ServiceProvider
*
* @var bool
*/
protected $defer = false;
protected $defer = true;

/**
* Bootstrap the application events.
Expand Down
8 changes: 5 additions & 3 deletions src/Console/Commands/ArtisanPhpCsFixerFix.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ public function fire()
}

if (!is_null($this->option('config'))) {
$commandParams[] = '--config="'.base_path($this->option('config')).'"';
$configFile = base_path($this->option('config'));
} elseif (file_exists(base_path('.php_cs'))) {
$commandParams[] = '--config="'.base_path('.php_cs').'"';
$configFile = base_path('.php_cs');
} else {
$commandParams[] = '--config="'.__DIR__.'/../../Config/.php_cs"';
$configFile = __DIR__.'/../../Config/.php_cs';
}

$commandParams[] = '--config="'.realpath($configFile).'"';

if ($this->option('dry-run')) {
$commandParams[] = '--dry-run';
}
Expand Down

0 comments on commit d643fc3

Please sign in to comment.