| Conditions | 2 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php namespace Pz\Doctrine\Rest; |
||
| 31 | 11 | public static function exception(\Exception $exception) |
|
| 32 | { |
||
| 33 | 11 | if (!$exception instanceof RestException) { |
|
| 34 | 1 | $exception = RestException::createFromException($exception); |
|
| 35 | } |
||
| 36 | |||
| 37 | 11 | return RestResponse::create(['errors' => $exception->errors()], $exception->getCode()); |
|
| 38 | } |
||
| 54 |