| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 15 | 8 | public function executeRequest(string $uri, string $body): string |
|
| 16 | { |
||
| 17 | 8 | $curl = curl_init(); |
|
| 18 | |||
| 19 | 8 | curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10); |
|
| 20 | 8 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
|
| 21 | 8 | curl_setopt($curl, CURLOPT_TIMEOUT, 60); |
|
| 22 | 8 | curl_setopt($curl, CURLOPT_POST, 1); |
|
| 23 | 8 | curl_setopt($curl, CURLOPT_POSTFIELDS, $body); |
|
| 24 | 8 | curl_setopt($curl, CURLOPT_URL, $uri); |
|
| 25 | |||
| 26 | 8 | $response = curl_exec($curl); |
|
| 27 | |||
| 28 | 8 | curl_close($curl); |
|
| 29 | |||
| 30 | 8 | return $response; |
|
| 31 | } |
||
| 32 | } |
||
| 33 |