Passed
Push — master ( c97f61...125742 )
by Jérémy
01:58
created

TaskDto::estimate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JDecool\Clockify\Model;
6
7
class TaskDto
8
{
9
    private $assigneeId;
10
    private $estimate;
11
    private $id;
12
    private $name;
13
    private $projectId;
14
    private $status;
15
16
    public static function fromArray(array $data): self
17
    {
18
        return new self(
19
            $data['assigneeId'],
20
            $data['estimate'],
21
            $data['id'],
22
            $data['name'],
23
            $data['projectId'],
24
            new TaskStatus($data['status']),
25
        );
26
    }
27
28
    public function __construct(
29
        string $assigneeId,
30
        string $estimate,
31
        string $id,
32
        string $name,
33
        string $projectId,
34
        TaskStatus $status
35
    ) {
36
        $this->assigneeId = $assigneeId;
37
        $this->estimate = $estimate;
38
        $this->id = $id;
39
        $this->name = $name;
40
        $this->projectId = $projectId;
41
        $this->status = $status;
42
    }
43
44
    public function assigneeId(): string
45
    {
46
        return $this->assigneeId;
47
    }
48
49
    public function estimate(): string
50
    {
51
        return $this->estimate;
52
    }
53
54
    public function id(): string
55
    {
56
        return $this->id;
57
    }
58
59
    public function name(): string
60
    {
61
        return $this->name;
62
    }
63
64
    public function projectId(): string
65
    {
66
        return $this->projectId;
67
    }
68
69
    public function status(): TaskStatus
70
    {
71
        return $this->status;
72
    }
73
}
74