Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function makeRequest($request = "", $type = "GET") |
||
27 | { |
||
28 | $this->setRequestURL($this->CF->getEndpoint() . $request); |
||
29 | |||
30 | //Use in testing to not actualy make the request |
||
31 | if ($this->CF->getMakeRequests() === false) { |
||
32 | return true; |
||
33 | } |
||
34 | |||
35 | $client = new Client(); |
||
36 | |||
37 | $this->request = $client->request($type, $this->getRequestURL(), [ |
||
38 | 'headers' => [ |
||
39 | 'X-Auth-Key' => $this->CF->getAPIKEY(), |
||
40 | 'X-Auth-Email' => $this->CF->getEmail() |
||
41 | ] |
||
42 | ]); |
||
43 | |||
44 | $response = (string) $this->request->getBody(); |
||
45 | $this->response = @json_decode($response); |
||
46 | |||
47 | return $this; |
||
48 | } |
||
49 | |||
55 |