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.

Milestone   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 61
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 6 1
A find() 0 6 1
A complete() 0 4 1
A uncomplete() 0 4 1
1
<?php  namespace Rossedman\Teamwork; 
2
3
use Rossedman\Teamwork\Traits\RestfulTrait;
4
5
class Milestone extends AbstractObject {
6
7
    use RestfulTrait;
8
9
    protected $wrapper  = 'milestone';
10
11
    protected $endpoint = 'milestones';
12
13
    /**
14
     * GET /milestones.json
15
     *
16
     * @param null $args
17
     *
18
     * @return mixed
19
     */
20
    public function all($args = null)
21
    {
22
        $this->areArgumentsValid($args, ['getProgress']);
0 ignored issues
show
Documentation introduced by
$args is of type null, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
23
24
        return $this->client->get($this->endpoint, $args)->response();
25
    }
26
27
    /**
28
     * GET /milestones/{milestone_id}.json
29
     *
30
     * @param null $args
31
     *
32
     * @return mixed
33
     */
34
    public function find($args = null)
35
    {
36
        $this->areArgumentsValid($args, ['getProgress', 'showTaskLists', 'showTasks']);
0 ignored issues
show
Documentation introduced by
$args is of type null, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
37
38
        return $this->client->get("$this->endpoint/$this->id", $args)->response();
39
    }
40
41
    /**
42
     * PUT /milestones/{id}/complete.json
43
     *
44
     * @param array $data
45
     *
46
     * @return
47
     */
48
    public function complete($data = [])
49
    {
50
        return $this->client->put("$this->endpoint/$this->id/complete", [$this->wrapper => $data])->response();
51
    }
52
53
    /**
54
     * PUT /milestones/{id}/uncomplete.json
55
     *
56
     * @param array $data
57
     *
58
     * @return
59
     */
60
    public function uncomplete($data = [])
61
    {
62
        return $this->client->put("$this->endpoint/$this->id/uncomplete", [$this->wrapper => $data])->response();
63
    }
64
65
}