| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | private function connect() |
||
| 45 | { |
||
| 46 | $url = $this->base . $this->endpoint; |
||
| 47 | $ch = curl_init($url); |
||
| 48 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
||
|
|
|||
| 49 | $result = curl_exec($ch); |
||
| 50 | $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
||
| 51 | curl_close($ch); |
||
| 52 | |||
| 53 | if (!$this->codeResponse($httpcode)) { |
||
| 54 | return null; |
||
| 55 | } |
||
| 56 | |||
| 57 | return $this->setResponse($result); |
||
| 58 | } |
||
| 94 | } |