Skip to content

Commit

Permalink
Merge pull request #6 from JackieDo/2.x
Browse files Browse the repository at this point in the history
Update core
  • Loading branch information
JackieDo authored Jun 15, 2020
2 parents 7e28536 + c49954d commit c22bccb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,23 @@
],
"require": {
"php": ">=5.6.4",
"illuminate/support": "5.3.*|5.4.*",
"friendsofphp/php-cs-fixer": "2.13.*"
"illuminate/support": "^5.3",
"friendsofphp/php-cs-fixer": "^2.13"
},
"require-dev": {
"illuminate/console": "5.3.*|5.4.*"
"illuminate/console": "^5.3"
},
"autoload": {
"psr-4": {
"Jackiedo\\ArtisanPhpCsFixer\\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"Jackiedo\\ArtisanPhpCsFixer\\ArtisanPhpCsFixerServiceProvider"
]
}
},
"minimum-stability": "stable"
}
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 c22bccb

Please sign in to comment.