Conditions | 2 |
Paths | 4 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
25 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
26 | { |
||
27 | $container = $this->getContainer(); |
||
28 | $client = $container->get('vmpro_api.client'); |
||
29 | $vmId = $container->getParameter('vm_pro_api_default_vm_id'); |
||
30 | |||
31 | 4 | $output->writeln(''); |
|
32 | |||
33 | 4 | try { |
|
34 | 4 | $client->getChannels($vmId)->getName(); |
|
35 | 4 | $output->writeln('<fg=green;options=bold> ✔ Connecting with the API succeeded.</>'); |
|
36 | $output->writeln(''); |
||
37 | 4 | ||
38 | return 0; |
||
39 | } catch (\Exception $e) { |
||
40 | 4 | $output->writeln('<bg=red;fg=white;options=bold> ✘ Connecting with the API failed..</>'); |
|
41 | 2 | $output->writeln(''); |
|
42 | 2 | ||
43 | return 1; |
||
44 | 2 | } |
|
45 | 2 | } |
|
46 | } |
||
47 |