Conditions | 2 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
20 | 1 | public function handle(): void |
|
21 | { |
||
22 | /** @var Client $http */ |
||
23 | 1 | $http = resolve(Client::class); |
|
24 | 1 | $response = $http->get('https://fondbot.io/api/drivers'); |
|
25 | 1 | $items = json_decode((string) $response->getBody(), true); |
|
26 | |||
27 | 1 | $drivers = collect($items) |
|
28 | 1 | ->map(function ($item) { |
|
29 | 1 | return [$item['name'], $item['package'], $item['official'] ? '✅' : '❌']; |
|
30 | 1 | }) |
|
31 | ->toArray(); |
||
32 | |||
33 | $table = new Table($this->output); |
||
34 | $table |
||
35 | ->setHeaders(['Name', 'Package', 'Official']) |
||
36 | ->setRows($drivers) |
||
37 | ->render(); |
||
38 | } |
||
39 | } |
||
40 |