Task::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 9
ccs 8
cts 8
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 task.
9
     *
10
     * @var string
11
     */
12
    public $id;
13
14
    /**
15
     * The reference number of the task.
16
     *
17
     * @var string
18
     */
19
    public $refNumber;
20
21
    /**
22
     * The title of the task.
23
     *
24
     * @var string
25
     */
26
    public $title;
27
28
    /**
29
     * The description of the task.
30
     *
31
     * @var string
32
     */
33
    public $description;
34
35
    /**
36
     * The task status.
37
     *
38
     * @var array
39
     */
40
    public $status;
41
42
    /**
43
     * The task priority.
44
     *
45
     * @var array
46
     */
47
    public $priority;
48
49
    /**
50
     * The task assignee.
51
     *
52
     * @var array
53
     */
54
    public $assignee;
55
56
    /**
57
     * Create a new resource instance.
58
     *
59
     * @param $attributes
60
     */
61 3
    public function __construct(array $attributes)
62
    {
63 3
        $this->id = $attributes['id'] ?? null;
64 3
        $this->refNumber = $attributes['refNumber'] ?? null;
65 3
        $this->title = $attributes['title'];
66 3
        $this->description = $attributes['description'];
67 3
        $this->status = $attributes['status'];
68 3
        $this->priority = $attributes['priority'] ?? null;
69 3
        $this->assignee = $attributes['assignee'] ?? null;
70
    }
71
}
72