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 ( db0197...4ce89b )
by Cees-Jan
8s
created

Repository::refresh()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis\Resource\Sync;
5
6
use WyriHaximus\ApiClient\Resource\CallAsyncTrait;
7
use WyriHaximus\Travis\Resource\Repository as BaseRepository;
8
use function Clue\React\Block\await;
9
use function React\Promise\resolve;
10
use WyriHaximus\Travis\Resource\SettingsInterface;
11
use WyriHaximus\Travis\Resource\RepositoryKeyInterface;
12
13
class Repository extends BaseRepository
14
{
15
    use CallAsyncTrait;
16
17
    /**
18
     * @return array
19
     */
20
    public function builds(): array
21
    {
22
        return $this->wait($this->observableToPromise($this->callAsync('builds')->toArray()));
23
    }
24
25
    /**
26
     * @param int $id
27
     * @return Build
28
     */
29
    public function build(int $id): Build
30
    {
31
        return $this->wait($this->callAsync('build', $id));
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function commits(): array
38
    {
39
        return $this->wait($this->observableToPromise($this->callAsync('commits')->toArray()));
40
    }
41
42
    /**
43
     * @return SettingsInterface
44
     */
45
    public function settings(): SettingsInterface
46
    {
47
        return $this->wait($this->callAsync('settings'));
48
    }
49
50
    /**
51
     * @return bool
52
     */
53
    public function isActive(): bool
54
    {
55
        return $this->wait($this->callAsync('isActive'));
56
    }
57
58
    /**
59
     * @return Repository
60
     */
61
    public function enable(): Repository
62
    {
63
        return $this->wait($this->callAsync('enable'));
64
    }
65
66
    /**
67
     * @return Repository
68
     */
69
    public function disable(): Repository
70
    {
71
        return $this->wait($this->callAsync('disable'));
72
    }
73
74
    /**
75
     * @return array
76
     */
77
    public function branches(): array
78
    {
79
        return $this->wait($this->observableToPromise($this->callAsync('branches')->toArray()));
80
    }
81
82
    /**
83
     * @return array
84
     */
85
    public function vars(): array
86
    {
87
        return $this->wait($this->observableToPromise($this->callAsync('vars')->toArray()));
88
    }
89
90
    /**
91
     * @return array
92
     */
93
    public function caches(): array
94
    {
95
        return $this->wait($this->observableToPromise($this->callAsync('caches')->toArray()));
96
    }
97
98
    /**
99
     * @return RepositoryKeyInterface
100
     */
101
    public function key(): RepositoryKeyInterface
102
    {
103
        return $this->wait($this->callAsync('key'));
104
    }
105
106
    /**
107
     * @return Repository
108
     */
109
    public function refresh(): Repository
110
    {
111
        return $this->wait($this->callAsync('refresh'));
112
    }
113
}
114