| Conditions | 3 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function handle() |
||
| 11 | { |
||
| 12 | // Nothing requested --> show models overview |
||
| 13 | $output = new HtmlOutput($this->config); |
||
| 14 | try { |
||
| 15 | $deviceList = new DeviceList($this->config->paths['models']); |
||
| 16 | $models = $deviceList->getDevices(); |
||
| 17 | if (count($models) == 0) { |
||
| 18 | $output->setTemplate('html_modellist_none'); |
||
| 19 | } else { |
||
| 20 | $output->setVariable('modellist', $models); |
||
| 21 | $output->setTemplate('html_modellist'); |
||
| 22 | } |
||
| 23 | } catch (\Exception $e) { |
||
| 24 | $output->setVariable('errorMessage', $e->getMessage()); |
||
| 25 | $output->setTemplate('html_modellist_error'); |
||
| 26 | } |
||
| 27 | $output->setVariable('is_devicelist', true); |
||
| 28 | $output->output(); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |