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.

Project::archivedMessages()   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
use Ciromattia\Teamwork\Traits\TimeTrait;
6
use Ciromattia\Teamwork\Traits\RestfulTrait;
7
8
class Project extends TeamworkObject
9
{
10
    use RestfulTrait, TimeTrait;
11
12
    protected $wrapper = 'project';
13
    protected $endpoint = 'projects';
14
15
    /**
16
     * Get Project Activity
17
     * GET /projects/{project_id}/activity.json
18
     *
19
     * @return  mixed
20
     */
21
    public function activity($args = null)
22
    {
23
        $this->areArgumentsValid($args, ['maxItems']);
24
25
        return $this->client->get("$this->endpoint/$this->id/latestActivity", $args)->response();
26
    }
27
28
    /**
29
     * Get Companies In Project
30
     * GET /projects/{project_id}/companies.json
31
     *
32
     * @retun mixed
33
     */
34
    public function companies()
35
    {
36
        return $this->client->get("$this->endpoint/$this->id/companies")->response();
37
    }
38
39
    /**
40
     * Get People On Project
41
     * GET /projects/{project_id}/people.json
42
     *
43
     * @return mixed
44
     */
45
    public function people()
46
    {
47
        return $this->client->get("$this->endpoint/$this->id/people")->response();
48
    }
49
50
    /**
51
     * Get Starred Projects
52
     * GET /projects/starred.json
53
     *
54
     * @return mixed
55
     */
56
    public function starred()
57
    {
58
        return $this->client->get("$this->endpoint/starred")->response();
59
    }
60
61
    /**
62
     * Star A Project
63
     * PUT /projects/{$id}/star.json
64
     *
65
     * @return mixed
66
     */
67
    public function star()
68
    {
69
        return $this->client->put("$this->endpoint/$this->id/star", [])->response();
70
    }
71
72
    /**
73
     * Unstar A Project
74
     * PUT /projects/{$id}/unstar.json
75
     *
76
     * @return mixed
77
     */
78
    public function unstar()
79
    {
80
        return $this->client->put("$this->endpoint/$this->id/unstar", [])->response();
81
    }
82
83
    /**
84
     * All Project Links
85
     * GET /projects/{id}/links.json
86
     *
87
     * @return mixed
88
     */
89
    public function links()
90
    {
91
        return $this->client->get("$this->endpoint/$this->id/links")->response();
92
    }
93
94
    /**
95
     * Time Totals
96
     * GET /projects/{id}/time/total.json
97
     *
98
     * @return mixed
99
     */
100
    public function timeTotal()
101
    {
102
        return $this->client->get("$this->endpoint/$this->id/time/total")->response();
103
    }
104
105
    /**
106
     * Latest Messages
107
     * GET /projects/{project_id}/posts.json
108
     *
109
     * @return mixed
110
     */
111
    public function latestMessages()
112
    {
113
        return $this->client->get("$this->endpoint/$this->id/posts")->response();
114
    }
115
116
    /**
117
     * Archived Messages
118
     * GET /projects/{project_id}/posts/archive.json
119
     *
120
     * @return mixed
121
     */
122
    public function archivedMessages()
123
    {
124
        return $this->client->get("$this->endpoint/$this->id/posts/archive")->response();
125
    }
126
127
    /**
128
     * List Milestones
129
     * GET /projects/{project_id}/milestones.json
130
     *
131
     * @param null $args
132
     *
133
     * @return mixed
134
     */
135
    public function milestones($args = null)
136
    {
137
        $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...
138
139
        return $this->client->get("$this->endpoint/$this->id/milestones", $args)->response();
140
    }
141
142
    /**
143
     * Create milestone associated with this project
144
     * POST /projects/{project_id}/milestones.json
145
     *
146
     * @param $args
147
     *
148
     * @return mixed
149
     */
150
    public function createMilestone($args)
151
    {
152
        return $this->client->post("$this->endpoint/$this->id/milestones", ['milestone' => $args])->response();
153
    }
154
155
    /**
156
     * Create tasklist associated with this project
157
     * POST /projects/{project_id}/tasklists.json
158
     *
159
     * @param $args
160
     *
161
     * @return mixed
162
     */
163
    public function createTasklist($args)
164
    {
165
        return $this->client->post("$this->endpoint/$this->id/tasklists", ['todo-list' => $args])->response();
166
    }
167
168
    /**
169
     * Tasklists
170
     * GET /projects/{project_id}/tasklists.json
171
     *
172
     * @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...
173
     */
174
    public function tasklists($args = null)
175
    {
176
        return $this->client->get("$this->endpoint/$this->id/tasklists", $args)->response();
177
    }
178
179
    /**
180
     * Tasks
181
     * GET /projects/{project_id}/tasks.json
182
     *
183
     * @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...
184
     */
185
    public function tasks($args = null)
186
    {
187
        return $this->client->get("$this->endpoint/$this->id/tasks", $args)->response();
188
    }
189
190
    /**
191
     * Emailaddresses
192
     * GET /projects/{project_id}/emailaddress.json
193
     *
194
     * @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...
195
     */
196
    public function emailAddress($args = null)
197
    {
198
        return $this->client->get("$this->endpoint/$this->id/emailaddress", $args)->response();
199
    }
200
201
    /**
202
     * Roles
203
     * GET /projects/{project_id}/roles.json
204
     *
205
     * @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...
206
     */
207
    public function roles($args = null)
208
    {
209
        return $this->client->get("$this->endpoint/$this->id/roles", $args)->response();
210
    }
211
212
    /**
213
     * Times
214
     * GET /projects/{project_id}/time_entries.json
215
     *
216
     * @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...
217
     */
218
    public function timeEntries($args = null)
219
    {
220
        return $this->client->get("$this->endpoint/$this->id/time_entries", $args)->response();
221
    }
222
}
223