Conditions | 5 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
54 | 14 | public function getAllAsObject(string $key = null) |
|
55 | { |
||
56 | 14 | $commands = $this->getAll(); |
|
57 | 14 | if (!empty($commands)) { |
|
58 | 13 | foreach ($commands as $commandKey => $commandDetails) { |
|
59 | 13 | if (!empty($key) && $commandKey !== $key) { |
|
60 | 7 | continue; |
|
61 | } |
||
62 | |||
63 | 13 | $commandDetails['key'] = $commandKey; |
|
64 | 13 | $commands[$commandKey] = $this->mapToCommandObject($commandDetails); |
|
65 | } |
||
66 | } |
||
67 | |||
68 | 14 | return $commands; |
|
69 | } |
||
70 | |||
100 |