Conditions | 4 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function handle(): void |
||
29 | { |
||
30 | try { |
||
31 | $installedDrivers = collect($this->channelManager->getDrivers())->keys()->toArray(); |
||
32 | $availableDrivers = $this->api->getDrivers(); |
||
33 | |||
34 | $rows = collect($availableDrivers) |
||
35 | ->transform(function ($item) use ($installedDrivers) { |
||
36 | return [ |
||
37 | $item['name'], |
||
38 | $item['package'], |
||
39 | $item['official'] ? '✅' : '❌', |
||
40 | in_array($item['name'], $installedDrivers, true) ? '✅' : '❌', |
||
41 | ]; |
||
42 | }) |
||
43 | ->toArray(); |
||
44 | |||
45 | $this->table(['Name', 'Package', 'Official', 'Installed'], $rows); |
||
46 | } catch (ClientException $exception) { |
||
47 | $this->error('Connection to FondBot API failed. Please check your internet connection and try again.'); |
||
48 | } |
||
51 |