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

Client::repository()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis;
5
6
use React\EventLoop\Factory as LoopFactory;
7
use WyriHaximus\Travis\Resource\Sync\Repository;
8
use WyriHaximus\Travis\Transport\Client as Transport;
9
use WyriHaximus\Travis\Transport\Factory;
10
use function Clue\React\Block\await;
11
use function React\Promise\resolve;
12
13
class Client
14
{
15
    protected $transport;
16
    protected $client;
17
18
    public function __construct(Transport $transport = null)
19
    {
20
        $loop = LoopFactory::create();
21
        if (!($transport instanceof Transport)) {
22
            $transport = Factory::create($loop, [
23
                'resource_namespace' => 'Sync',
24
            ]);
25
        }
26
        $this->transport = $transport;
27
        $this->client = new AsyncClient($loop, $this->transport);
28
    }
29
30
    public function repository(string $repository): Repository
31
    {
32
        return await(
33
            $this->client->repository($repository),
34
            $this->transport->getLoop()
35
        );
36
    }
37
}
38