| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function parse(ApiException $exception): string |
||
| 19 | { |
||
| 20 | if ($exception->hasResponse()) { |
||
| 21 | $response = $exception->getResponse(); |
||
| 22 | $responseBodyAsString = json_decode((string) $response->getBody(), true); |
||
| 23 | if (isset($responseBodyAsString['extra']['failureReason'])) { |
||
| 24 | return $responseBodyAsString['extra']['failureReason']; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | return ''; |
||
| 29 | } |
||
| 31 |