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.

Client::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 14
cts 14
cp 1
rs 9.584
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Vindi\Http;
4
5
use GuzzleHttp\Client as Guzzle;
6
use Vindi\Vindi;
7
8
/**
9
 * Class Client
10
 *
11
 * @package Vindi\Http
12
 */
13
class Client extends Guzzle
14
{
15
    /**
16
     * Client constructor.
17
     */
18 462
    public function __construct(array $config = [])
19
    {
20 462
        $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
21
22 462
        $config = array_merge([
23 462
            'base_uri' => Vindi::getApiUri(),
24 462
            'auth' => [Vindi::getApiKey(), '', 'BASIC'],
25
            'headers' => [
26 462
                'Content-Type' => 'application/json',
27 462
                'User-Agent' => trim('Vindi-PHP/' . Vindi::$sdkVersion . "; {$host}"),
28 462
            ],
29 462
            'verify' => Vindi::getCertPath(),
30 462
            'timeout' => Vindi::getApiTimeOut(),
31
            'curl.options' => [
32 462
                'CURLOPT_SSLVERSION' => 'CURL_SSLVERSION_TLSv1_2',
33
            ]
34 462
        ], $config);
35
36
37 462
        parent::__construct($config);
38 462
    }
39
}
40