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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 6
Bugs 2 Features 0
Metric Value
wmc 3
c 6
b 2
f 0
lcom 1
cbo 4
dl 0
loc 25
ccs 0
cts 18
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A repository() 0 7 1
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