WorkItem::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 10
ccs 9
cts 9
cp 1
crap 1
rs 10
1
<?php
2
3
namespace TestMonitor\DevOps\Resources;
4
5
class WorkItem extends Resource
6
{
7
    /**
8
     * The id of the work item.
9
     *
10
     * @var string
11
     */
12
    public $id;
13
14
    /**
15
     * The area path for the work item.
16
     *
17
     * @var string
18
     */
19
    public $path;
20
21
    /**
22
     * The title of the work item.
23
     *
24
     * @var string
25
     */
26
    public $title;
27
28
    /**
29
     * The description for the work item.
30
     *
31
     * @var string
32
     */
33
    public $description;
34
35
    /**
36
     * The state of the work item.
37
     *
38
     * @var string
39
     */
40
    public $state;
41
42
    /**
43
     * The type of the work item.
44
     *
45
     * @var string
46
     */
47
    public $workItemType;
48
49
    /**
50
     * The repro steps for the work item.
51
     *
52
     * @var string
53
     */
54
    public $stepsToReproduce;
55
56
    /**
57
     * The url for the work item.
58
     *
59
     * @var string
60
     */
61
    public $url;
62
63
    /**
64
     * Create a new resource instance.
65
     *
66
     * @param array $attributes
67
     */
68 6
    public function __construct(array $attributes)
69
    {
70 6
        $this->id = $attributes['id'] ?? null;
71 6
        $this->title = $attributes['title'];
72 6
        $this->description = $attributes['description'] ?? '';
73 6
        $this->state = $attributes['state'] ?? '';
74 6
        $this->workItemType = $attributes['workItemType'];
75 6
        $this->stepsToReproduce = $attributes['stepsToReproduce'] ?? '';
76 6
        $this->path = $attributes['path'] ?? null;
77 6
        $this->url = $attributes['url'] ?? '';
78
    }
79
}
80