Completed
Push — master ( 10b44f...a11b2a )
by Thijs
17:21 queued 17:19
created

Task::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
ccs 7
cts 7
cp 1
crap 1
rs 10
1
<?php
2
3
namespace TestMonitor\DoneDone\Resources;
4
5
class Task extends Resource
6
{
7
    /**
8
     * The id of the issue.
9
     *
10
     * @var string
11
     */
12
    public $id;
13
14
    /**
15
     * The title of the task.
16
     *
17
     * @var string
18
     */
19
    public $title;
20
21
    /**
22
     * The description of the task.
23
     *
24
     * @var string
25
     */
26
    public $description;
27
28
    /**
29
     * The task status.
30
     *
31
     * @var array
32
     */
33
    public $status;
34
35
    /**
36
     * The task priority.
37
     *
38
     * @var array
39
     */
40
    public $priority;
41
42
    /**
43
     * The task assignee.
44
     *
45
     * @var array
46
     */
47
    public $assignee;
48
49
    /**
50
     * Create a new resource instance.
51
     *
52
     * @param $attributes
53
     */
54 3
    public function __construct(array $attributes)
55
    {
56 3
        $this->id = $attributes['id'] ?? null;
57 3
        $this->title = $attributes['title'];
58 3
        $this->description = $attributes['description'];
59 3
        $this->status = $attributes['status'];
60 3
        $this->priority = $attributes['priority'] ?? null;
61 3
        $this->assignee = $attributes['assignee'] ?? null;
62 3
    }
63
}
64