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 (#29)
by Cees-Jan
08:06
created

Repository   B

Complexity

Total Complexity 16

Size/Duplication

Total Lines 120
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 16

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 16
lcom 1
cbo 16
dl 0
loc 120
rs 8.4614
c 0
b 0
f 0
ccs 0
cts 47
cp 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A refresh() 0 6 1
A branches() 0 6 1
A commits() 0 6 1
A labels() 0 6 1
A addLabel() 0 6 1
A contents() 0 8 1
A communityHealth() 0 6 1
A tags() 0 6 1
A releases() 0 6 1
A languages() 0 6 1
A addFile() 0 19 2
A subscribe() 0 6 1
A unSubscribe() 0 6 1
A replaceTopics() 0 6 1
A travisRepository() 0 4 1
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\Contents\FileUploadCommand;
11
use ApiClients\Client\Github\CommandBus\Command\Repository\ContentsCommand;
12
use ApiClients\Client\Github\CommandBus\Command\Repository\LabelsCommand;
13
use ApiClients\Client\Github\CommandBus\Command\Repository\LanguagesCommand;
14
use ApiClients\Client\Github\CommandBus\Command\Repository\ReleasesCommand;
15
use ApiClients\Client\Github\CommandBus\Command\Repository\ReplaceTopicsCommand;
16
use ApiClients\Client\Github\CommandBus\Command\Repository\SubscribeCommand;
17
use ApiClients\Client\Github\CommandBus\Command\Repository\TagsCommand;
18
use ApiClients\Client\Github\CommandBus\Command\Repository\TravisCommand;
19
use ApiClients\Client\Github\CommandBus\Command\Repository\UnSubscribeCommand;
20
use ApiClients\Client\Github\Resource\Repository as BaseRepository;
21
use React\Promise\PromiseInterface;
22
use React\Stream\ReadableStreamInterface;
23
use Rx\Observable;
24
use Rx\ObservableInterface;
25
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
26
27
class Repository extends BaseRepository
28
{
29
    public function refresh(): PromiseInterface
30
    {
31
        return $this->handleCommand(
32
            new RefreshCommand($this)
33
        );
34
    }
35
36
    public function branches(): ObservableInterface
37
    {
38
        return unwrapObservableFromPromise($this->handleCommand(
39
            new BranchesCommand($this->fullName())
40
        ));
41
    }
42
43
    public function commits(): ObservableInterface
44
    {
45
        return unwrapObservableFromPromise($this->handleCommand(
46
            new CommitsCommand($this->fullName())
47
        ));
48
    }
49
50
    public function labels(): ObservableInterface
51
    {
52
        return unwrapObservableFromPromise($this->handleCommand(
53
            new LabelsCommand($this->fullName())
54
        ));
55
    }
56
57
    public function addLabel(string $name, string $colour): PromiseInterface
58
    {
59
        return $this->handleCommand(
60
            new AddLabelCommand($this->fullName(), $name, $colour)
61
        );
62
    }
63
64
    public function contents(string $path = '/'): Observable
65
    {
66
        return unwrapObservableFromPromise(
67
            $this->handleCommand(
68
                new ContentsCommand($this->fullName(), $path)
69
            )
70
        );
71
    }
72
73
    public function communityHealth(): PromiseInterface
74
    {
75
        return $this->handleCommand(
76
            new CommunityHealthCommand($this->fullName())
77
        );
78
    }
79
80
    public function tags(): ObservableInterface
81
    {
82
        return unwrapObservableFromPromise($this->handleCommand(
83
            new TagsCommand($this->fullName())
84
        ));
85
    }
86
87
    public function releases(): ObservableInterface
88
    {
89
        return unwrapObservableFromPromise($this->handleCommand(
90
            new ReleasesCommand($this->fullName())
91
        ));
92
    }
93
94
    public function languages(): PromiseInterface
95
    {
96
        return $this->handleCommand(
97
            new LanguagesCommand($this->fullName())
98
        );
99
    }
100
101
    public function addFile(
102
        string $filename,
103
        ReadableStreamInterface $stream,
104
        string $commitMessage = '',
105
        string $branch = ''
106
    ): PromiseInterface {
107
        if ($commitMessage === '') {
108
            $commitMessage = 'Update ' . $this->name;
109
        }
110
111
        return $this->handleCommand(new FileUploadCommand(
112
            $this->full_name,
113
            $commitMessage,
114
            '/repos/' . $this->full_name . '/contents/' . $filename,
115
            '',
116
            $branch,
117
            $stream
118
        ));
119
    }
120
121
    public function subscribe(bool $subscribed = true, bool $ignored = false): PromiseInterface
122
    {
123
        return $this->handleCommand(
124
            new SubscribeCommand($this->fullName(), $subscribed, $ignored)
125
        );
126
    }
127
128
    public function unSubscribe(): PromiseInterface
129
    {
130
        return $this->handleCommand(
131
            new UnSubscribeCommand($this->fullName())
132
        );
133
    }
134
135
    public function replaceTopics(string ...$topics): PromiseInterface
136
    {
137
        return $this->handleCommand(
138
            new ReplaceTopicsCommand($this->fullName(), ...$topics)
139
        );
140
    }
141
142
    public function travisRepository(): PromiseInterface
143
    {
144
        return $this->handleCommand(new TravisCommand($this->fullName()));
145
    }
146
}
147