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 ( dcd0c7...a5712b )
by Cees-Jan
7s
created

Repository::commits()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 10
loc 10
ccs 0
cts 5
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 React\Promise\PromiseInterface;
7
use Rx\Observable;
8
use Rx\ObservableInterface;
9
use Rx\React\Promise;
10
use WyriHaximus\Travis\Resource\Repository as BaseRepository;
11
use function React\Promise\resolve;
12
13
class Repository extends BaseRepository
14
{
15 View Code Duplication
    public function builds(): ObservableInterface
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
    {
17
        return Promise::toObservable(
18
            $this->getTransport()->request('repos/' . $this->slug() . '/builds')
19
        )->flatMap(function ($response) {
20
            return Observable::fromArray($response['builds']);
21
        })->map(function ($build) {
22
            return $this->getTransport()->getHydrator()->hydrate('Build', $build);
23
        });
24
    }
25
26 View Code Duplication
    public function build(int $id): PromiseInterface
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        return $this->getTransport()->request(
29
            'repos/' . $this->slug() . '/builds/' . $id
30
        )->then(function ($response) {
31
            return resolve($this->getTransport()->getHydrator()->hydrate('Build', $response['build']));
32
        });
33
    }
34
35 View Code Duplication
    public function commits(): ObservableInterface
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
36
    {
37
        return Promise::toObservable(
38
            $this->getTransport()->request('repos/' . $this->slug() . '/builds')
39
        )->flatMap(function ($response) {
40
            return Observable::fromArray($response['commits']);
41
        })->map(function ($build) {
42
            return $this->getTransport()->getHydrator()->hydrate('Commit', $build);
43
        });
44
    }
45
}
46