Skip to content

Commit

Permalink
Simplify \Illuminate\Console\Command::context().
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot committed Jan 4, 2019
1 parent 9a8f5f1 commit 7d5d3e6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Illuminate\Console;

use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Support\Arrayable;
Expand Down Expand Up @@ -238,15 +237,15 @@ protected function createInputFromArguments(array $arguments)
*/
protected function context()
{
return collect(Arr::only($this->option(), [
return collect($this->option())->only([
'ansi',
'no-ansi',
'no-interaction',
'quiet',
'verbose',
]))->mapWithKeys(function ($value, $key) {
])->filter()->mapWithKeys(function ($value, $key) {
return ["--{$key}" => $value];
})->filter()->all();
})->all();
}

/**
Expand Down

0 comments on commit 7d5d3e6

Please sign in to comment.