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

AsyncClient::repository()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis;
5
6
use React\EventLoop\LoopInterface;
7
use React\Promise\PromiseInterface;
8
use WyriHaximus\Travis\Transport\Client as Transport;
9
use WyriHaximus\Travis\Transport\Factory;
10
use function React\Promise\resolve;
11
12
class AsyncClient
13
{
14
    protected $transport;
15
16
    public function __construct(LoopInterface $loop, Transport $transport = null)
17
    {
18
        if (!($transport instanceof Transport)) {
19
            $transport = Factory::create($loop, [
20
                'resource_namespace' => 'Async',
21
            ]);
22
        }
23
        $this->transport = $transport;
24
    }
25
26
    public function repository(string $repository): PromiseInterface
27
    {
28
        return $this->transport->request('repos/' . $repository)->then(function ($json) {
29
            return resolve($this->transport->getHydrator()->hydrate('Repository', $json['repo']));
30
        });
31
    }
32
}
33