| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function __construct(Response $response) |
||
| 18 | { |
||
| 19 | $message = array_key_exists('error', $response->json()) |
||
| 20 | ? "{$response->json()['error']}: {$response->json()['error_description']}" |
||
| 21 | : "{$response->json()['errors'][0]['title']}: {$response->json()['errors'][0]['detail']}"; |
||
| 22 | |||
| 23 | parent::__construct( |
||
| 24 | $message, |
||
| 25 | $response->status() |
||
| 26 | ); |
||
| 29 |