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::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2
Metric Value
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 9.4285
cc 2
eloc 9
nc 2
nop 2
crap 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