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.

HttplugClientFactory::createClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
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\HttplugConnection;
15
use Http\Client\HttpClient;
16
use Http\Message\MessageFactory;
17
18
final class HttplugClientFactory implements ClientFactoryInterface
19
{
20
    /**
21
     * @var HttpClient
22
     */
23
    private $client;
24
25
    /**
26
     * @var MessageFactory
27
     */
28
    private $messageFactory;
29
30
    /**
31
     * Initialize client.
32
     */
33
    public function __construct(HttpClient $client, MessageFactory $messageFactory)
34
    {
35
        $this->client         = $client;
36
        $this->messageFactory = $messageFactory;
37
    }
38
39
    public function createClient(string $host, string $token): ClientInterface
40
    {
41
        $connection = new HttplugConnection($this->client, $this->messageFactory, $host);
42
43
        return new Client($connection, $token);
44
    }
45
}
46