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 — master ( a9ce78...3cd954 )
by Sho
8s
created

RequestV2   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
3
namespace ShippoClient\Http;
4
5
class RequestV2 extends Request
6
{
7
    const BASE_URI = 'https://api.goshippo.com/';
8
9
    /**
10
     * @param $accessToken
11
     * @param null $apiVersion
12
     */
13
    public function __construct($accessToken, $apiVersion = null)
14
    {
15
        parent::__construct($accessToken);
16
        $request_headers = ['Authorization' => 'ShippoToken ' . $accessToken];
17
        if ($apiVersion) {
18
            $request_headers['Shippo-API-Version'] = $apiVersion;
19
        }
20
21
        $this->delegated->setConfig(['request.options' => ['headers' => $request_headers]]);
22
    }
23
}
24