| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function execute($query, array $variables = array()) |
||
| 33 | { |
||
| 34 | // Build the request path. |
||
| 35 | $path = '/graphql'; |
||
| 36 | |||
| 37 | $headers = array( |
||
| 38 | 'Accept' => 'application/vnd.github.v4+json', |
||
| 39 | 'Content-Type' => 'application/json', |
||
| 40 | ); |
||
| 41 | |||
| 42 | $data = array( |
||
| 43 | 'query' => $query, |
||
| 44 | ); |
||
| 45 | |||
| 46 | if (!empty($variables)) |
||
| 47 | { |
||
| 48 | $data['variables'] = $variables; |
||
| 49 | } |
||
| 50 | |||
| 51 | // Send the request. |
||
| 52 | return $this->processResponse( |
||
| 53 | $this->client->post($this->fetchUrl($path), json_encode($data), $headers) |
||
| 54 | ); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |