Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | private function dispatch(): void |
||
44 | { |
||
45 | $curl = curl_init(); |
||
46 | $fields = http_build_query($this->fields); |
||
47 | |||
48 | curl_setopt_array($curl, array( |
||
49 | CURLOPT_URL => $this->apiUrl, |
||
50 | CURLOPT_RETURNTRANSFER => true, |
||
51 | CURLOPT_MAXREDIRS => 10, |
||
52 | CURLOPT_TIMEOUT => 30, |
||
53 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
||
54 | CURLOPT_CUSTOMREQUEST => $this->method, |
||
55 | CURLOPT_POSTFIELDS => $fields, |
||
56 | CURLOPT_HTTPHEADER => [], |
||
57 | )); |
||
58 | |||
59 | $this->response = json_decode(curl_exec($curl)); |
||
|
|||
60 | curl_close($curl); |
||
61 | } |
||
62 | } |