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