GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 06e328...3bdb15 )
by
unknown
14s
created

Graphql::execute()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 24
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 11
nc 2
nop 2
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
1
<?php
2
/**
3
 * Part of the Joomla Framework Github Package
4
 *
5
 * @copyright  Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
6
 * @license    GNU General Public License version 2 or later; see LICENSE
7
 */
8
9
namespace Joomla\Github\Package;
10
11
use Joomla\Github\AbstractPackage;
12
13
/**
14
 * GitHub API GraphQL class for the Joomla Framework.
15
 *
16
 * @link   https://developer.github.com/v4/
17
 *
18
 * @since  1.6.0
19
 */
20
class Graphql extends AbstractPackage
21
{
22
	/**
23
	 * Execute a query against the GraphQL API.
24
	 *
25
	 * @param   string  $query      The query to perform.
26
	 * @param   array   $variables  An optional array of variables to include in the request.
27
	 *
28
	 * @return  string
29
	 *
30
	 * @since   1.6.0
31
	 */
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