| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function execute(string $endpoint, array $params): array |
||
| 16 | { |
||
| 17 | $bodyParams = $this->buildRequestParams($params); |
||
| 18 | |||
| 19 | $this->addCurlOpt(CURLOPT_URL, "{$this->credentials->getHost()}{$endpoint}") |
||
| 20 | ->addCurlOpt(CURLOPT_CUSTOMREQUEST, EnumHttpMethods::POST) |
||
| 21 | ->addCurlOpt(CURLOPT_ENCODING, '') |
||
| 22 | ->addCurlOpt(CURLOPT_MAXREDIRS, 10) |
||
| 23 | ->addCurlOpt(CURLOPT_TIMEOUT, 0) |
||
| 24 | ->addCurlOpt(CURLOPT_FOLLOWLOCATION, true) |
||
| 25 | ->addCurlOpt(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1) |
||
| 26 | ->addCurlOpt(CURLOPT_POSTFIELDS, $bodyParams); |
||
| 27 | |||
| 28 | $this->auth($bodyParams); |
||
| 29 | |||
| 30 | return $this->query(); |
||
|
|
|||
| 31 | } |
||
| 42 |