| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function normalize($object, $format = null, array $context = []): array |
||
| 31 | { |
||
| 32 | $data = []; |
||
| 33 | |||
| 34 | if (isset($context['status_code'])) { |
||
| 35 | $data['code'] = $statusCode = $context['status_code']; |
||
| 36 | } |
||
| 37 | |||
| 38 | $data['message'] = $this->getMessageFromThrowable($object, isset($statusCode) ? $statusCode : null); |
||
| 39 | |||
| 40 | return $data; |
||
| 41 | } |
||
| 42 | |||
| 51 |
If you suppress an error, we recommend checking for the error condition explicitly: