| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 4 | public function parseErrors(Response $response) |
|
| 39 | { |
||
| 40 | 4 | $result = $response->parseResponseStringToObject(); |
|
| 41 | 4 | $error_key = Config::get('error_handler.errors_key'); |
|
|
|
|||
| 42 | |||
| 43 | 4 | if (property_exists($result, $error_key)) { |
|
| 44 | 4 | return $result->errors; |
|
| 45 | } |
||
| 46 | |||
| 47 | 1 | throw new \InvalidArgumentException("Error key [{$error_key}] does not exist in response"); |
|
| 48 | } |
||
| 50 |