Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 3 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
49 | protected function doRequest($url, $method, array $options = []) |
||
50 | { |
||
51 | try { |
||
52 | $response = $this->client->request( |
||
53 | strtoupper($method), |
||
54 | $url, |
||
55 | $options |
||
56 | ); |
||
57 | } catch (ClientException $e) { |
||
58 | if ($e->hasResponse()) { |
||
59 | throw new BadRequestException( |
||
60 | 'Error while sending request', |
||
61 | $this->credentials['provider_name'], |
||
62 | $e->getCode(), |
||
63 | $e |
||
64 | ); |
||
65 | } |
||
66 | } |
||
67 | |||
68 | return json_decode($response->getBody()->getContents()); |
||
69 | } |
||
70 | |||
87 |