| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | 3 | private function parseYaml() |
|
| 36 | { |
||
| 37 | try { |
||
| 38 | /** @var array $archlist */ |
||
| 39 | 3 | $archlist = Yaml::parse(file_get_contents($this->yamlFilepath)); |
|
| 40 | 3 | } catch (ParseException $e) { |
|
| 41 | 1 | throw new \Exception($e->getMessage()); |
|
| 42 | } |
||
| 43 | 2 | $idx = 0; |
|
| 44 | 2 | $sortkey = array(); |
|
| 45 | 2 | foreach ($archlist as $arch => $archmodels) { |
|
| 46 | 2 | foreach ($archmodels as $model) { |
|
| 47 | 2 | $this->devices[$idx] = array( |
|
| 48 | 2 | 'arch' => $arch, |
|
| 49 | 2 | 'name' => $model, |
|
| 50 | ); |
||
| 51 | 2 | $sortkey[$idx] = $model; |
|
| 52 | 2 | $idx++; |
|
| 53 | 2 | } |
|
| 54 | 2 | } |
|
| 55 | 2 | array_multisort($sortkey, SORT_NATURAL|SORT_FLAG_CASE, $this->devices); |
|
| 56 | 2 | } |
|
| 57 | |||
| 68 |