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 ( 352f99...e3c5ff )
by Cees-Jan
09:24
created

JobCollection   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1
Metric Value
wmc 5
lcom 1
cbo 1
dl 44
loc 44
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getRequest() 4 4 1
A fromResponse() 4 4 1
A getBuild() 4 4 1
A getIterator() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace WyriHaximus\Travis;
4
5
use ArrayIterator;
6
use IteratorAggregate;
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\ResponseInterface;
9
10 View Code Duplication
class JobCollection implements EndpointInterface, IteratorAggregate
0 ignored issues
show
Duplication introduced by
This class 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...
11
{
12
    use ParentHasClientAwareTrait;
13
14
    /**
15
     * @var Repository
16
     */
17
    protected $build;
18
19
    /**
20
     * @var array
21
     */
22
    protected $builds;
23
24
    public function __construct(Build $build, array $builds)
25
    {
26
        $this->setParent($build);
27
        $this->build = $build;
0 ignored issues
show
Documentation Bug introduced by
It seems like $build of type object<WyriHaximus\Travis\Build> is incompatible with the declared type object<WyriHaximus\Travis\Repository> of property $build.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
28
        $this->builds = $builds;
29
    }
30
31
    public function getRequest(): RequestInterface
32
    {
33
        // TODO: Implement getRequest() method.
34
    }
35
36
    public function fromResponse(ResponseInterface $response): EndpointInterface
37
    {
38
        // TODO: Implement fromResponse() method.
39
    }
40
41
    /**
42
     * @return Repository
43
     */
44
    public function getBuild()
45
    {
46
        return $this->build;
47
    }
48
49
    public function getIterator()
50
    {
51
        return new ArrayIterator($this->builds);
52
    }
53
}
54