| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 2 | public function process($params, $path) { |
|
| 25 | 2 | $client = new Client([ |
|
| 26 | 2 | 'timeout' => $this->config->timeout, |
|
| 27 | 2 | ]); |
|
| 28 | |||
| 29 | 2 | $path = '/' . $this->config->serviceName . $path; |
|
| 30 | 2 | $method = 'POST'; |
|
| 31 | 2 | $signedHeaders = Signature::getHeaderSign($this->config, $method, $path); |
|
| 32 | |||
| 33 | 2 | $url = $this->config->getSyncVideoEndPoint() . $path; |
|
| 34 | 2 | $response = $client->request($method, $url, [ |
|
| 35 | 2 | 'headers' => $signedHeaders, |
|
| 36 | 'json' => $params |
||
| 37 | 2 | ]); |
|
| 38 | |||
| 39 | 2 | $body = $response->getBody()->getContents(); |
|
| 40 | 2 | return json_decode($body, true); |
|
| 41 | } |
||
| 42 | } |