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.

Tasklist::find()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Ciromattia\Teamwork;
4
5
class Tasklist extends TeamworkObject
6
{
7
8
    protected $wrapper = 'todo-list';
9
    protected $endpoint = 'tasklists';
10
11
    /**
12
     * GET /tasklists/{$id}.json
13
     * @return mixed
14
     */
15
    public function find()
16
    {
17
        return $this->client->get("$this->endpoint/$this->id")->response();
18
    }
19
20
    /**
21
     * PUT /todo_lists/{$id}.json
22
     * @return mixed
23
     */
24
    public function update($data)
25
    {
26
        return $this->client->put("$this->endpoint/$this->id", [$this->wrapper => $data])->response();
27
    }
28
29
    /**
30
     * DELETE /todo_lists/{$id}.json
31
     * @return mixed
32
     */
33
    public function delete()
34
    {
35
        return $this->client->delete("$this->endpoint/$this->id")->response();
36
    }
37
38
    /**
39
     * GET /tasklists/templates.json
40
     * @return [type] [description]
0 ignored issues
show
Documentation introduced by
The doc-type [type] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
41
     */
42
    public function templates()
43
    {
44
        return $this->client->get("$this->endpoint/templates")->response();
45
    }
46
47
    /**
48
     * Time Totals
49
     * GET /projects/{id}/time/total.json
50
     *
51
     * @return mixed
52
     */
53
    public function timeTotal()
54
    {
55
        return $this->client->get("$this->endpoint/$this->id/time/total")->response();
56
    }
57
58
    /**
59
     * Tasks
60
     * GET /tasklists/{id}/tasks.json
61
     *
62
     * @param null $args
63
     *
64
     * @return mixed
65
     */
66
    public function tasks($args = null)
67
    {
68
        $this->areArgumentsValid($args, ['filter', 'page', 'pageSize', 'startdate', 'enddate', 'updatedAfterDate', 'completedAfterDate', 'completedBeforeDate', 'showDeleted', 'includeCompletedTasks', 'includeCompletedSubtasks', 'creator-ids', 'include', 'responsible-party-ids', 'sort', 'getSubTasks', 'nestSubTasks', 'getFiles', 'dataSet', 'includeToday', 'ignore-start-date']);
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...
69
70
        return $this->client->get("$this->endpoint/$this->id/tasks", $args)->response();
71
    }
72
73
    /**
74
     * Create Task
75
     * GET /tasklists/{id}/tasks.json
76
     *
77
     * @return mixed
78
     */
79
    public function createTask($data)
80
    {
81
        return $this->client->post("tasklists/$this->id/tasks", ['todo-item' => $data])->response();
82
    }
83
}
84