Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
23 | 8 | public function query(string $query, array $variables = []): Response |
|
24 | { |
||
25 | $options = [ |
||
26 | 'json' => [ |
||
27 | 8 | 'query' => $query, |
|
28 | 8 | 'variables' => $variables, |
|
29 | ], |
||
30 | ]; |
||
31 | |||
32 | try { |
||
33 | 8 | $response = $this->httpClient->request('POST', '', $options); |
|
34 | 2 | } catch (TransferException $e) { |
|
35 | 2 | throw new \RuntimeException('Network Error.'); |
|
36 | } |
||
37 | |||
38 | 6 | return $this->responseBuilder->build($response); |
|
39 | } |
||
40 | } |
||
41 |