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 ( 3abaaf...dcd0c7 )
by Cees-Jan
8s
created

Factory::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6
Metric Value
dl 0
loc 20
ccs 0
cts 19
cp 0
rs 9.4285
cc 2
eloc 10
nc 2
nop 2
crap 6
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis\Transport;
5
6
use Aws\Handler\GuzzleV6\GuzzleHandler;
7
use GuzzleHttp\Client as GuzzleClient;
8
use GuzzleHttp\HandlerStack;
9
use React\EventLoop\Factory as LoopFactory;
10
use React\EventLoop\LoopInterface;
11
use WyriHaximus\React\GuzzlePsr7\HttpClientAdapter;
12
13
class Factory
14
{
15
    public static function create(LoopInterface $loop = null, array $options = []): Client
16
    {
17
        if (!($loop instanceof LoopInterface)) {
18
            $loop = LoopFactory::create();
19
        }
20
21
        return new Client(
22
            $loop,
23
            new GuzzleHandler(
24
                new GuzzleClient(
25
                    [
26
                        'handler' => HandlerStack::create(
27
                            new HttpClientAdapter($loop)
28
                        ),
29
                    ]
30
                )
31
            ),
32
            $options
33
        );
34
    }
35
}
36