Conditions | 2 |
Paths | 2 |
Total Lines | 30 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 23 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | 2 | protected function execute(InputInterface $input, OutputInterface $output) |
|
29 | { |
||
30 | 2 | $server = $input->getArgument('server'); |
|
31 | |||
32 | 2 | $capabilities = $this |
|
33 | 2 | ->getContainer() |
|
34 | 2 | ->get('innmind_rest.client.capabilities_factory') |
|
35 | 2 | ->make($server); |
|
36 | 2 | $loader = $this |
|
37 | 2 | ->getContainer() |
|
38 | 2 | ->get('innmind_rest.client.loader_factory') |
|
39 | 2 | ->make($server); |
|
40 | |||
41 | 2 | $output->writeln(sprintf( |
|
42 | 2 | 'Fetching exposed resources at <fg=cyan>%s</fg=cyan>', |
|
43 | $server |
||
44 | 2 | )); |
|
45 | 2 | $capabilities->refresh(); |
|
46 | |||
47 | 2 | foreach ($capabilities->keys() as $name => $url) { |
|
48 | 2 | $output->writeln(sprintf( |
|
49 | 2 | 'Fetching definition for the resource "<fg=cyan>%s</fg=cyan>" at "<fg=cyan>%s</fg=cyan>"', |
|
50 | 2 | $name, |
|
51 | $url |
||
52 | 2 | )); |
|
53 | 2 | $loader->refresh($url); |
|
54 | 2 | } |
|
55 | |||
56 | 2 | $output->writeln('<success>All definitions loaded</success>'); |
|
57 | 2 | } |
|
58 | } |
||
59 |