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
Pull Request — master (#21)
by Cees-Jan
07:18
created

Repository::subscribe()   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

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 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\CommitsCommand;
9
use ApiClients\Client\Github\CommandBus\Command\Repository\CommunityHealthCommand;
10
use ApiClients\Client\Github\CommandBus\Command\Repository\ContentsCommand;
11
use ApiClients\Client\Github\CommandBus\Command\Repository\LabelsCommand;
12
use ApiClients\Client\Github\CommandBus\Command\Repository\LanguagesCommand;
13
use ApiClients\Client\Github\CommandBus\Command\Repository\ReleasesCommand;
14
use ApiClients\Client\Github\CommandBus\Command\Repository\SubscribeCommand;
15
use ApiClients\Client\Github\CommandBus\Command\Repository\TagsCommand;
16
use ApiClients\Client\Github\CommandBus\Command\Repository\UnSubscribeCommand;
17
use ApiClients\Client\Github\Resource\Repository as BaseRepository;
18
use React\Promise\PromiseInterface;
19
use Rx\Observable;
20
use Rx\ObservableInterface;
21
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
22
23
class Repository extends BaseRepository
24
{
25
    public function refresh(): PromiseInterface
26
    {
27
        return $this->handleCommand(
28
            new RefreshCommand($this)
29
        );
30
    }
31
32
    public function branches(): ObservableInterface
33
    {
34
        return unwrapObservableFromPromise($this->handleCommand(
35
            new BranchesCommand($this->fullName())
36
        ));
37
    }
38
39
    public function commits(): ObservableInterface
40
    {
41
        return unwrapObservableFromPromise($this->handleCommand(
42
            new CommitsCommand($this->fullName())
43
        ));
44
    }
45
46
    public function labels(): ObservableInterface
47
    {
48
        return unwrapObservableFromPromise($this->handleCommand(
49
            new LabelsCommand($this->fullName())
50
        ));
51
    }
52
53
    public function addLabel(string $name, string $colour): PromiseInterface
54
    {
55
        return $this->handleCommand(
56
            new AddLabelCommand($this->fullName(), $name, $colour)
57
        );
58
    }
59
60
    public function contents(string $path = '/'): Observable
61
    {
62
        return unwrapObservableFromPromise(
63
            $this->handleCommand(
64
                new ContentsCommand($this->fullName(), $path)
65
            )
66
        );
67
    }
68
69
    public function communityHealth(): PromiseInterface
70
    {
71
        return $this->handleCommand(
72
            new CommunityHealthCommand($this->fullName())
73
        );
74
    }
75
76
    public function tags(): ObservableInterface
77
    {
78
        return unwrapObservableFromPromise($this->handleCommand(
79
            new TagsCommand($this->fullName())
80
        ));
81
    }
82
83
    public function releases(): ObservableInterface
84
    {
85
        return unwrapObservableFromPromise($this->handleCommand(
86
            new ReleasesCommand($this->fullName())
87
        ));
88
    }
89
90
    public function languages(): PromiseInterface
91
    {
92
        return $this->handleCommand(
93
            new LanguagesCommand($this->fullName())
94
        );
95
    }
96
97
    public function subscribe(bool $subscribed = true, bool $ignored = false): PromiseInterface
98
    {
99
        return $this->handleCommand(
100
            new SubscribeCommand($this->fullName(), $subscribed, $ignored)
101
        );
102
    }
103
104
    public function unSubscribe(): PromiseInterface
105
    {
106
        return $this->handleCommand(
107
            new UnSubscribeCommand($this->fullName())
108
        );
109
    }
110
}
111