Skip to content

Commit cfc3ac9

Browse files
committed
fix array options
1 parent 7f00dbb commit cfc3ac9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Illuminate/Console/Scheduling/Schedule.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Illuminate\Contracts\Queue\ShouldQueue;
1212
use Illuminate\Queue\CallQueuedClosure;
1313
use Illuminate\Support\ProcessUtils;
14+
use Illuminate\Support\Str;
1415
use Illuminate\Support\Traits\Macroable;
1516
use RuntimeException;
1617

@@ -198,7 +199,11 @@ public function exec($command, array $parameters = [])
198199
protected function compileParameters(array $parameters)
199200
{
200201
return collect($parameters)->map(function ($value, $key) {
201-
if (is_array($value)) {
202+
if (is_array($value) && Str::startsWith($key, '--')) {
203+
return collect($value)->map(function ($value) use ($key) {
204+
return $key.'='.ProcessUtils::escapeArgument($value);
205+
})->implode(' ');
206+
} elseif (is_array($value)) {
202207
$value = collect($value)->map(function ($value) {
203208
return ProcessUtils::escapeArgument($value);
204209
})->implode(' ');

0 commit comments

Comments
 (0)