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; |
||
22 | 2 | public static function exception(\Exception $exception) |
|
23 | { |
||
24 | 2 | if (!$exception instanceof RestException) { |
|
25 | $exception = RestException::createFromException($exception); |
||
26 | } |
||
27 | |||
28 | 2 | return RestResponse::create(['errors' => $exception->errors()], $exception->getCode()); |
|
29 | } |
||
31 |