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