| Conditions | 2 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2.9765 |
| 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 | $items = json_decode((string) $response->getBody(), true); |
||
| 26 | |||
| 27 | $drivers = collect($items) |
||
| 28 | ->map(function ($item) { |
||
| 29 | return [$item['name'], $item['package'], $item['official'] ? '✅' : '❌']; |
||
| 30 | }) |
||
| 31 | ->toArray(); |
||
| 32 | |||
| 33 | $table = new Table($this->output); |
||
| 34 | $table |
||
| 35 | ->setHeaders(['Name', 'Package', 'Official']) |
||
| 36 | ->setRows($drivers) |
||
| 37 | ->render(); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |