| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function toArray(): array |
||
| 14 | 5 | { |
|
| 15 | 5 | $return = [ |
|
| 16 | 5 | 'code' => $this->getCode(), |
|
| 17 | 'message' => $this->getMessage(), |
||
| 18 | ]; |
||
| 19 | |||
| 20 | /** @var ExceptionInterface|array $field */ |
||
| 21 | 3 | foreach ($this->getFields() as $field) { |
|
| 22 | $return['fields'][] = is_array($field) ? $field : $field->toArray(); |
||
| 23 | } |
||
| 24 | 3 | ||
| 25 | 3 | return $return; |
|
| 26 | 3 | } |
|
| 28 |