Skip to content

Commit

Permalink
Merge pull request #27065 from lucasmichot/feature/5.7/simplify-comma…
Browse files Browse the repository at this point in the history
…nd-context

[5.7] Simplify \Illuminate\Console\Command::context().
  • Loading branch information
taylorotwell authored Jan 4, 2019
2 parents 9155faa + f9b17bd commit 33503c0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Illuminate/Console/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 33503c0

Please sign in to comment.