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 ( ac3a4b...a5d460 )
by Cees-Jan
01:55
created

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 18 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\ApiClient\Transport;
5
6
use GuzzleHttp\Client as GuzzleClient;
7
use GuzzleHttp\HandlerStack;
8
use React\EventLoop\Factory as LoopFactory;
9
use React\EventLoop\LoopInterface;
10
use WyriHaximus\React\GuzzlePsr7\HttpClientAdapter;
11
12
class Factory
13
{
14 2
    public static function create(LoopInterface $loop = null, array $options = []): Client
15
    {
16 2
        if (!($loop instanceof LoopInterface)) {
17 1
            $loop = LoopFactory::create();
18
        }
19
20 2
        return new Client(
21
            $loop,
22 2
            new GuzzleClient(
23
                [
24 2
                    'handler' => HandlerStack::create(
25 2
                        new HttpClientAdapter($loop)
26
                    ),
27
                ]
28
            ),
29
            $options
30
        );
31
    }
32
}
33