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 ( 71a4f9...212da1 )
by Cees-Jan
06:21
created

Builds::matrix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace WyriHaximus\Travis;
4
5
use Psr\Http\Message\RequestInterface;
6
use Psr\Http\Message\ResponseInterface;
7
8
class Builds implements EndpointInterface
9
{
10
    use ParentHasClientAwareTrait;
11
12
    /**
13
     * @var Repository
14
     */
15
    protected $repository;
16
17
    public function __construct(Repository $repository)
18
    {
19
        $this->setParent($repository);
20
        $this->repository = $repository;
21
    }
22
23
    public function getRequest(): RequestInterface
24
    {
25
        return $this->parent->getClient()->createRequert('GET', 'repos/' . $this->repository->getRepository() . '/builds');
26
    }
27
28
    public function fromResponse(ResponseInterface $response): EndpointInterface
29
    {
30
        $json = json_decode($response->getBody()->getContents());
31
        $builds = $this->createBuilds($json);
32
        return new BuildCollection($this->repository, $builds);
33
    }
34
35
    protected function createBuilds($json)
36
    {
37
        $builds = [];
38
        foreach ($json->builds as $build) {
39
            $builds[] = new Build($this->repository, $build);
40
        }
41
        return $builds;
42
    }
43
44
    public function matrix()
45
    {
46
47
    }
48
}
49