| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function send(Request $request) |
||
| 20 | { |
||
| 21 | $ch = curl_init($request->getUri()); |
||
| 22 | |||
| 23 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
||
| 24 | |||
| 25 | if (!empty($request->getHeaders())) { |
||
| 26 | curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders()); |
||
| 27 | } |
||
| 28 | |||
| 29 | if ($request->getMethod() === 'POST' && !empty($request->getBody())) { |
||
| 30 | curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getBody()); |
||
| 31 | } |
||
| 32 | |||
| 33 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'); |
||
| 34 | |||
| 35 | $this->response = curl_exec($ch); |
||
| 36 | curl_close($ch); |
||
| 37 | } |
||
| 38 | |||
| 52 | } |