| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function normalize($object, $format = null, array $context = []) |
||
| 33 | { |
||
| 34 | $res = [ |
||
| 35 | 'type' => (new ReflectionClass($object))->getShortName(), |
||
| 36 | 'message' => $object->getMessage(), |
||
| 37 | 'code' => $object->getCode(), |
||
| 38 | ]; |
||
| 39 | if ($this->showStack) { |
||
| 40 | $res['trace'] = $object->getTraceAsString(); |
||
| 41 | } |
||
| 42 | if ($object instanceof ValidationException) { |
||
| 43 | $res['errors'] = $object->getErrors(); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $res; |
||
| 47 | } |
||
| 59 |