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
07:38
created

Repository   B

Complexity

Total Complexity 17

Size/Duplication

Total Lines 125
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 17

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 17
lcom 1
cbo 17
dl 0
loc 125
rs 7.8571
c 0
b 0
f 0
ccs 0
cts 46
cp 0

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