Conditions | 6 |
Paths | 6 |
Total Lines | 14 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 6.0131 |
Changes | 0 |
1 | <?php |
||
56 | 10 | public function handleResponse($response) { |
|
57 | 10 | switch ($response->getStatusCode()) { |
|
58 | 10 | case 200: |
|
59 | 10 | case 201: |
|
60 | 10 | case 202: |
|
61 | 2 | return; |
|
62 | 8 | case 400: |
|
63 | 4 | throw ApiError::serviceBadRequest($response->getBody()); |
|
64 | 4 | case 429: |
|
65 | 2 | throw ApiError::rateLimit(); |
|
66 | 2 | default: |
|
67 | 2 | throw ApiError::unknownError($response->getStatusCode()); |
|
68 | 2 | } |
|
69 | } |
||
70 | } |
||
71 |