Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public static function createForResponse(Response $response) |
||
17 | { |
||
18 | $exception = new static(static::getMessageForResponse($response)); |
||
19 | |||
20 | $exception->response = $response; |
||
21 | |||
22 | $bodyErrors = isset($response->getBody()['errors']) ? $response->getBody()['errors'] : []; |
||
23 | |||
24 | $exception->errors = $bodyErrors; |
||
25 | |||
26 | return $exception; |
||
27 | } |
||
28 | |||
34 |