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.

Task   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 3
dl 0
loc 67
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 6 1
A complete() 0 4 1
A uncomplete() 0 4 1
A timeTotal() 0 4 1
A edit() 0 4 1
1
<?php  namespace Rossedman\Teamwork;
2
3
use Rossedman\Teamwork\Traits\TimeTrait;
4
use Rossedman\Teamwork\Traits\RestfulTrait;
5
6
class Task extends AbstractObject {
7
8
    use RestfulTrait, TimeTrait;
9
10
    protected $wrapper  = 'task';
11
12
    protected $endpoint = 'tasks';
13
14
    /**
15
     * Get All Tasks
16
     * GET /tasks.json
17
     *
18
     * @param null $args
19
     *
20
     * @return mixed
21
     */
22
    public function all($args = null)
23
    {
24
        $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...
25
26
        return $this->client->get($this->endpoint, $args)->response();
27
    }
28
29
    /**
30
     * Complete A Task
31
     * PUT tasks/{id}/complete.json
32
     *
33
     * @return mixed
34
     */
35
    public function complete()
36
    {
37
        return $this->client->put("$this->endpoint/$this->id/complete", [])->response();
38
    }
39
40
    /**
41
     * Uncomplete A Task
42
     * PUT tasks/{id}/uncomplete.json
43
     *
44
     * @return mixed
45
     */
46
    public function uncomplete()
47
    {
48
        return $this->client->put("$this->endpoint/$this->id/uncomplete", [])->response();
49
    }
50
51
    /**
52
     * Time Totals
53
     * GET /projects/{id}/time/total.json
54
     *
55
     * @return mixed
56
     */
57
    public function timeTotal()
58
    {
59
        return $this->client->get("$this->endpoint/$this->id/time/total")->response();
60
    }
61
    
62
    /**
63
     * Edit A Task
64
     * PUT tasks/{id}.json
65
     *
66
     * @return mixed
67
     */
68
    public function edit($args)
69
    {
70
        return $this->client->put("$this->endpoint/$this->id.json", ['todo-item' => $args])->response();
71
    }
72
}