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 ( ae5fa7...163d7c )
by Cees-Jan
10:38 queued 08:37
created

Factory::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 9
nc 2
nop 2
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace ApiClients\Foundation\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
    /**
15
     * @param LoopInterface|null $loop
16
     * @param array $options
17
     * @return Client
18
     */
19 2
    public static function create(LoopInterface $loop = null, array $options = []): Client
20
    {
21 2
        if (!($loop instanceof LoopInterface)) {
22 1
            $loop = LoopFactory::create();
23
        }
24
25 2
        return new Client(
26
            $loop,
27 2
            new GuzzleClient(
28
                [
29 2
                    'handler' => HandlerStack::create(
30 2
                        new HttpClientAdapter($loop)
31
                    ),
32
                ]
33
            ),
34
            $options
35
        );
36
    }
37
}
38