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   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendRequest() 0 4 1
A __construct() 0 6 1
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