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
Pull Request — master (#31)
by Christian
02:50
created

PsrClientFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\MatomoBundle\Client;
13
14
use Core23\MatomoBundle\Connection\PsrClientConnection;
15
use Psr\Http\Client\ClientInterface as PsrClientInterface;
16
use Psr\Http\Message\RequestFactoryInterface;
17
18
final class PsrClientFactory implements ClientFactoryInterface
19
{
20
    /**
21
     * @var PsrClientInterface
22
     */
23
    private $client;
24
25
    /**
26
     * @var RequestFactoryInterface
27
     */
28
    private $requestFactory;
29
30
    /**
31
     * Initialize client.
32
     */
33
    public function __construct(PsrClientInterface $client, RequestFactoryInterface $requestFactory)
34
    {
35
        $this->client         = $client;
36
        $this->requestFactory = $requestFactory;
37
    }
38
39
    public function createClient(string $host, string $token): ClientInterface
40
    {
41
        $connection = new PsrClientConnection($this->client, $this->requestFactory, $host);
42
43
        return new Client($connection, $token);
44
    }
45
}
46