Skip to content

Commit aec612f

Browse files
committed
refactor: #4 merge fix to code command
1 parent 11f3b22 commit aec612f

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

src/LintCodeCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class LintCodeCommand extends Command
1515
*/
1616
protected $signature = 'lint:code
1717
{files*}
18+
{--fix : automatic fix}
1819
{--standard=phpcs.xml : coding standards}';
1920

2021
/**
@@ -31,8 +32,9 @@ class LintCodeCommand extends Command
3132
*/
3233
public function handle()
3334
{
35+
$bin = $this->option('fix') ? 'phpcbf' : 'phpcs';
3436
exec(
35-
'vendor/bin/phpcs --standard=' . $this->option('standard')
37+
"vendor/bin/$bin --standard=" . $this->option('standard')
3638
. ' ' . implode(' ', $this->argument('files')),
3739
$output,
3840
$code

src/LintFixCommand.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/LintServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public function boot()
1616
if ($this->app->runningInConsole()) {
1717
$this->commands([
1818
LintCodeCommand::class,
19-
LintFixCommand::class,
2019
LintPublishCommand::class,
2120
LintRouteCommand::class,
2221
LintStagedCommand::class,

0 commit comments

Comments
 (0)