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 ( 588993...886570 )
by Cees-Jan
08:02
created

AsyncClient   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 3
dl 0
loc 35
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A hydrate() 0 4 1
A extract() 0 4 1
A repository() 0 4 1
A addRepository() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiClients\Client\Scrutinizer\Github;
6
7
use ApiClients\Client\Scrutinizer\CommandBus\Command\Github\AddRepositoryCommand;
8
use ApiClients\Client\Scrutinizer\CommandBus\Command\Github\RepositoryCommand;
9
use ApiClients\Foundation\ClientInterface as FoundationClientInterface;
10
use ApiClients\Foundation\Resource\ResourceInterface;
11
use React\Promise\CancellablePromiseInterface;
12
use React\Promise\PromiseInterface;
13
14
final class AsyncClient implements AsyncClientInterface
15
{
16
    /**
17
     * @var FoundationClientInterface
18
     */
19
    protected $client;
20
21
    /**
22
     * @param FoundationClientInterface $client
23
     */
24
    public function __construct(FoundationClientInterface $client)
25
    {
26
        $this->client = $client;
27
    }
28
29
    public function hydrate(string $resource): CancellablePromiseInterface
30
    {
31
        return $this->client->hydrate($resource);
32
    }
33
34
    public function extract(ResourceInterface $resource): CancellablePromiseInterface
35
    {
36
        return $this->client->extract($resource);
37
    }
38
39
    public function repository(string $login, string $name): PromiseInterface
40
    {
41
        return $this->client->handle(new RepositoryCommand($login, $name));
42
    }
43
44
    public function addRepository(string $name): PromiseInterface
45
    {
46
        return $this->client->handle(new AddRepositoryCommand($name));
47
    }
48
}
49