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 (#18)
by Cees-Jan
06:28
created

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6
Metric Value
wmc 2
lcom 0
cbo 6
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 19 2
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): 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
        );
33
    }
34
}
35