| Conditions | 3 |
| Paths | 7 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function send($method, $uri = '', array $options = []) |
||
| 25 | { |
||
| 26 | $res = true; |
||
| 27 | |||
| 28 | try { |
||
| 29 | $response = $this->client->request(strtoupper($method), $uri, $options); |
||
| 30 | $this->code = $response->getStatusCode(); |
||
| 31 | $this->data = json_decode($response->getBody(), true); |
||
| 32 | } catch (ConnectException $e) { |
||
| 33 | $this->message = 'cannot connect to api!'; |
||
| 34 | $res = false; |
||
| 35 | } catch (ClientException $e) { |
||
| 36 | $this->message = $e->getResponse()->getBody(); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $res; |
||
| 40 | } |
||
| 41 | |||
| 73 |