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::find()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Ciromattia\Teamwork;
4
5
use Ciromattia\Teamwork\Traits\RestfulTrait;
6
7
class Milestone extends TeamworkObject
8
{
9
    use RestfulTrait;
10
11
    protected $wrapper = 'milestone';
12
    protected $endpoint = 'milestones';
13
14
    /**
15
     * GET /milestones.json
16
     *
17
     * @param null $args
18
     *
19
     * @return mixed
20
     */
21
    public function all($args = null)
22
    {
23
        $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...
24
25
        return $this->client->get($this->endpoint, $args)->response();
26
    }
27
28
    /**
29
     * GET /milestones/{milestone_id}.json
30
     *
31
     * @param null $args
32
     *
33
     * @return mixed
34
     */
35
    public function find($args = null)
36
    {
37
        $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...
38
39
        return $this->client->get("$this->endpoint/$this->id", $args)->response();
40
    }
41
42
    /**
43
     * PUT /milestones/{id}/complete.json
44
     *
45
     * @param array $data
46
     *
47
     * @return
48
     */
49
    public function complete($data = [])
50
    {
51
        return $this->client->put("$this->endpoint/$this->id/complete", [$this->wrapper => $data])->response();
52
    }
53
54
    /**
55
     * PUT /milestones/{id}/uncomplete.json
56
     *
57
     * @param array $data
58
     *
59
     * @return
60
     */
61
    public function uncomplete($data = [])
62
    {
63
        return $this->client->put("$this->endpoint/$this->id/uncomplete", [$this->wrapper => $data])->response();
64
    }
65
}