Conditions | 4 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | private function formatCommand(string $command, array $parameters) |
||
27 | { |
||
28 | $parameters = collect($parameters)->map(function ($parameter) { |
||
|
|||
29 | if (is_array($parameter)) { |
||
30 | return collect($parameter)->map(function ($value, $key) { |
||
31 | if (is_array($value)) { |
||
32 | return json_encode($value); |
||
33 | } |
||
34 | |||
35 | return is_int($key) ? $value : "{$key} {$value}"; |
||
36 | })->implode(' '); |
||
37 | } |
||
38 | |||
39 | return $parameter; |
||
40 | })->implode(' '); |
||
41 | |||
42 | return "{$command} {$parameters}"; |
||
43 | } |
||
45 |