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.

AuthenticatedCommonClient::sendRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 4
rs 10
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
namespace CommerceLeague\ActiveCampaignApi\Client;
6
7
use CommerceLeague\ActiveCampaignApi\Configuration\CommonConfiguration;
8
use Psr\Http\Message\ResponseInterface;
9
10
/**
11
 * Class AuthenticatedCommonClient
12
 */
13
class AuthenticatedCommonClient implements HttpClientInterface
14
{
15
    /**
16
     * @var CommonConfiguration
17
     */
18
    private $configuration;
19
20
    /**
21
     * @var HttpClientInterface
22
     */
23
    private $client;
24
25
    /**
26
     * @param CommonConfiguration $configuration
27
     * @param HttpClientInterface $client
28
     */
29
    public function __construct(
30
        CommonConfiguration $configuration,
31
        HttpClientInterface $client
32
    ) {
33
        $this->configuration = $configuration;
34
        $this->client = $client;
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40
    public function sendRequest(string $httpMethod, $uri, array $headers = [], $body = null): ResponseInterface
41
    {
42
        $headers['Api-Token'] = $this->configuration->getToken();
43
        return $this->client->sendRequest($httpMethod, $uri, $headers, $body);
44
    }
45
}
46