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