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 ( a7befa...3e14ee )
by Cees-Jan
10:18
created

Repository::addLabel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Github\Resource\Async;
4
5
use ApiClients\Client\Github\CommandBus\Command\RefreshCommand;
6
use ApiClients\Client\Github\CommandBus\Command\Repository\AddLabelCommand;
7
use ApiClients\Client\Github\CommandBus\Command\Repository\BranchesCommand;
8
use ApiClients\Client\Github\CommandBus\Command\Repository\ContentsCommand;
9
use ApiClients\Client\Github\CommandBus\Command\Repository\LabelsCommand;
10
use ApiClients\Client\Github\Resource\Repository as BaseRepository;
11
use ApiClients\Foundation\Transport\Response;
12
use React\Promise\PromiseInterface;
13
use Rx\Observable;
14
use Rx\ObservableInterface;
15
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
16
use function React\Promise\resolve;
17
18
class Repository extends BaseRepository
19
{
20
    public function refresh() : PromiseInterface
21
    {
22
        return $this->handleCommand(
23
            new RefreshCommand($this)
24
        );
25
    }
26
27
    public function branches(): ObservableInterface
28
    {
29
        return unwrapObservableFromPromise($this->handleCommand(
30
            new BranchesCommand($this->fullName())
31
        ));
32
    }
33
34
    public function labels(): ObservableInterface
35
    {
36
        return unwrapObservableFromPromise($this->handleCommand(
37
            new LabelsCommand($this->fullName())
38
        ));
39
    }
40
41
    public function addLabel(string $name, string $colour): PromiseInterface
42
    {
43
        return $this->handleCommand(
44
            new AddLabelCommand($this->fullName(), $name, $colour)
45
        );
46
    }
47
48
    public function contents(): Observable
49
    {
50
        return unwrapObservableFromPromise(
51
            $this->handleCommand(
52
                new ContentsCommand($this->fullName())
53
            )
54
        );
55
    }
56
}
57