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 (#18)
by Cees-Jan
02:09
created

Repository::builds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WyriHaximus\Travis\Resource\Async;
5
6
use Rx\Observable;
7
use Rx\ObservableInterface;
8
use Rx\React\Promise;
9
use WyriHaximus\Travis\Resource\Repository as BaseRepository;
10
use function React\Promise\resolve;
11
12
class Repository extends BaseRepository
13
{
14
    public function builds(): ObservableInterface
15
    {
16
        return Promise::toObservable(
17
            $this->getTransport()->request('repos/' . $this->slug() . '/builds')
18
        )->flatMap(function ($response) {
19
            return Observable::fromArray($response['builds']);
20
        })->map(function ($build) {
21
            return $this->getTransport()->hydrate('Build', $build);
22
        });
23
    }
24
}
25