Issue::removeIssueLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the GitControlBundle package.
4
 *
5
 * (c) Paul Schweppe <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace VersionControl\GitControlBundle\Entity\Issues;
12
13
abstract class Issue
14
{
15
    /**
16
     * @var string
17
     */
18
    private $title;
19
20
    /**
21
     * @var string
22
     */
23
    private $description;
24
25
    /**
26
     * State of issue.
27
     *
28
     * @var string
29
     */
30
    private $status;
31
32
    /**
33
     * @var \DateTime
34
     */
35
    private $closedAt;
36
37
    /**
38
     * @var \DateTime
39
     */
40
    private $createdAt;
41
42
    /**
43
     * @var \DateTime
44
     */
45
    private $updatedAt;
46
47
    /**
48
     * @var int
49
     */
50
    private $id;
51
52
    /**
53
     * @var \VersionControl\GitControlBundle\Entity\IssueMilestone
54
     */
55
    private $issueMilestone;
56
57
    /**
58
     * @var \VersionControl\GitControlBundle\Entity\Project
59
     */
60
    private $project;
61
62
    /**
63
     * @var array
64
     */
65
    private $issueLabel;
66
67
    /**
68
     * Issue comments.
69
     *
70
     * @var array
71
     */
72
    private $issueComments;
73
74
    /**
75
     * Constructor.
76
     */
77
    public function __construct()
78
    {
79
        $this->issueLabel = array();
80
        $this->issueComments = array();
81
        $this->setCreatedAt(new \DateTime());
82
        $this->setStatus('open');
83
    }
84
85
    public function setId($id)
86
    {
87
        $this->id = $id;
88
89
        return $this;
90
    }
91
92
    /**
93
     * Set title.
94
     *
95
     * @param string $title
96
     *
97
     * @return Issue
98
     */
99
    public function setTitle($title)
100
    {
101
        $this->title = $title;
102
103
        return $this;
104
    }
105
106
    /**
107
     * Get title.
108
     *
109
     * @return string
110
     */
111
    public function getTitle()
112
    {
113
        return $this->title;
114
    }
115
116
    /**
117
     * Set description.
118
     *
119
     * @param string $description
120
     *
121
     * @return Issue
122
     */
123
    public function setDescription($description)
124
    {
125
        $this->description = $description;
126
127
        return $this;
128
    }
129
130
    /**
131
     * Get description.
132
     *
133
     * @return string
134
     */
135
    public function getDescription()
136
    {
137
        return $this->description;
138
    }
139
140
    /**
141
     * Set status.
142
     *
143
     * @param string $status
144
     *
145
     * @return Issue
146
     */
147
    public function setStatus($status)
148
    {
149
        $this->status = $status;
150
151
        return $this;
152
    }
153
154
    /**
155
     * Get status.
156
     *
157
     * @return string
158
     */
159
    public function getStatus()
160
    {
161
        return $this->status;
162
    }
163
164
    /**
165
     * Set closedAt.
166
     *
167
     * @param \DateTime $closedAt
168
     *
169
     * @return Issue
170
     */
171
    public function setClosedAt($closedAt)
172
    {
173
        $this->closedAt = $closedAt;
174
175
        return $this;
176
    }
177
178
    /**
179
     * Get closedAt.
180
     *
181
     * @return \DateTime
182
     */
183
    public function getClosedAt()
184
    {
185
        return $this->closedAt;
186
    }
187
188
    /**
189
     * Set createdAt.
190
     *
191
     * @param \DateTime $createdAt
192
     *
193
     * @return Issue
194
     */
195
    public function setCreatedAt($createdAt)
196
    {
197
        $this->createdAt = $createdAt;
198
199
        return $this;
200
    }
201
202
    /**
203
     * Get createdAt.
204
     *
205
     * @return \DateTime
206
     */
207
    public function getCreatedAt()
208
    {
209
        return $this->createdAt;
210
    }
211
212
    /**
213
     * Set updatedAt.
214
     *
215
     * @param \DateTime $updatedAt
216
     *
217
     * @return Issue
218
     */
219
    public function setUpdatedAt($updatedAt)
220
    {
221
        $this->updatedAt = $updatedAt;
222
223
        return $this;
224
    }
225
226
    /**
227
     * Get updatedAt.
228
     *
229
     * @return \DateTime
230
     */
231
    public function getUpdatedAt()
232
    {
233
        return $this->updatedAt;
234
    }
235
236
    /**
237
     * Set githubNumber.
238
     *
239
     * @param int $githubNumber
240
     *
241
     * @return Issue
242
     */
243
    public function setGithubNumber($githubNumber)
244
    {
245
        $this->githubNumber = $githubNumber;
0 ignored issues
show
Bug Best Practice introduced by
The property githubNumber does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
246
247
        return $this;
248
    }
249
250
    /**
251
     * Get githubNumber.
252
     *
253
     * @return int
254
     */
255
    public function getGithubNumber()
256
    {
257
        return $this->githubNumber;
258
    }
259
260
    /**
261
     * Get id.
262
     *
263
     * @return int
264
     */
265
    public function getId()
266
    {
267
        return $this->id;
268
    }
269
270
    /**
271
     * Set issueMilestone.
272
     *
273
     * @param \VersionControl\GitControlBundle\Entity\IssueMilestone $issueMilestone
274
     *
275
     * @return Issue
276
     */
277
    public function setIssueMilestone(\VersionControl\GitControlBundle\IssueMilestone $issueMilestone = null)
0 ignored issues
show
Bug introduced by
The type VersionControl\GitControlBundle\IssueMilestone was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
278
    {
279
        $this->issueMilestone = $issueMilestone;
280
281
        return $this;
282
    }
283
284
    /**
285
     * Get issueMilestone.
286
     *
287
     * @return \VersionControl\GitControlBundle\Entity\IssueMilestone
288
     */
289
    public function getIssueMilestone()
290
    {
291
        return $this->issueMilestone;
292
    }
293
294
    /**
295
     * Set project.
296
     *
297
     * @param \VersionControl\GitControlBundle\Entity\Project $project
298
     *
299
     * @return Issue
300
     */
301
    public function setProject(\VersionControl\GitControlBundle\Entity\Project $project = null)
302
    {
303
        $this->project = $project;
304
305
        return $this;
306
    }
307
308
    /**
309
     * Get project.
310
     *
311
     * @return \VersionControl\GitControlBundle\Entity\Project
312
     */
313
    public function getProject()
314
    {
315
        return $this->project;
316
    }
317
318
    /**
319
     * Get User.
320
     *
321
     * @return \VersionControl\GitControlBundle\Entity\Issues\IssueUserInterface
322
     */
323
    public function getUser()
324
    {
325
        return $this->user;
0 ignored issues
show
Bug Best Practice introduced by
The property user does not exist on VersionControl\GitContro...dle\Entity\Issues\Issue. Did you maybe forget to declare it?
Loading history...
326
    }
327
328
    /**
329
     * Add issueLabel.
330
     *
331
     * @param \VersionControl\GitControlBundle\Entity\Issues\IssueLabel $issueLabel
332
     *
333
     * @return Issue
334
     */
335
    public function addIssueLabel(\VersionControl\GitControlBundle\Entity\Issues\IssueLabel $issueLabel)
336
    {
337
        $this->issueLabel[] = $issueLabel;
338
339
        return $this;
340
    }
341
342
    /**
343
     * Remove issueLabel.
344
     *
345
     * @param \VersionControl\GitControlBundle\Entity\Issues\IssueLabel $issueLabel
346
     */
347
    public function removeIssueLabel(\VersionControl\GitControlBundle\Entity\Issues\IssueLabel $issueLabel)
348
    {
349
        $this->issueLabel->removeElement($issueLabel);
350
    }
351
352
    /**
353
     * Get issueLabel.
354
     *
355
     * @return array
356
     */
357
    public function getIssueLabel()
358
    {
359
        return $this->issueLabel;
360
    }
361
362
    /**
363
     * Get Issue Comments.
364
     *
365
     * @return array of \VersionControl\GitControlBundle\Entity\Issue\IssueCommentInteface
366
     */
367
    public function getIssueComments()
368
    {
369
        return $this->issueComments;
370
    }
371
372
    /**
373
     * Set Issue Comments.
374
     *
375
     * @param array $issueComments
376
     *
377
     * @return \VersionControl\GitControlBundle\Entity\Issue
378
     */
379
    public function setIssueComments(array $issueComments)
380
    {
381
        $this->issueComments = $issueComments;
382
383
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type VersionControl\GitContro...dle\Entity\Issues\Issue which is incompatible with the documented return type VersionControl\GitControlBundle\Entity\Issue.
Loading history...
384
    }
385
386
    /**
387
     * Set status.
388
     *
389
     * @param string $status
390
     *
391
     * @return Issue
392
     */
393
    public function setClosed()
394
    {
395
        $this->status = 'closed';
396
397
        return $this;
398
    }
399
400
    /**
401
     * Set status.
402
     *
403
     * @param string $status
404
     *
405
     * @return Issue
406
     */
407
    public function setOpen()
408
    {
409
        $this->status = 'open';
410
411
        return $this;
412
    }
413
414
    public function isClosed()
415
    {
416
        return ($this->status === 'closed') ? true : false;
417
    }
418
}
419