UpdateTimeEntryRequest::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JDecool\Clockify\Api\TimeEntry;
6
7
class UpdateTimeEntryRequest
8
{
9
    private $start;
10
    private $billable;
11
    private $description;
12
    private $projectId;
13
    private $taskId;
14
    private $end;
15
    private $tagIds;
16
17
    /**
18
     * @param string[] $tagIds
19
     */
20
    public function __construct(
21
        string $start,
22
        bool $billable,
23
        string $description,
24
        string $projectId,
25
        string $taskId,
26
        string $end,
27
        array $tagIds
28
    ) {
29
        $this->start = $start;
30
        $this->billable = $billable;
31
        $this->description = $description;
32
        $this->projectId = $projectId;
33
        $this->taskId = $taskId;
34
        $this->end = $end;
35
        $this->tagIds = $tagIds;
36
    }
37
38
    public function start(): string
39
    {
40
        return $this->start;
41
    }
42
43
    public function billable(): bool
44
    {
45
        return $this->billable;
46
    }
47
48
    public function description(): string
49
    {
50
        return $this->description;
51
    }
52
53
    public function projectId(): string
54
    {
55
        return $this->projectId;
56
    }
57
58
    public function taskId(): string
59
    {
60
        return $this->taskId;
61
    }
62
63
    public function end(): string
64
    {
65
        return $this->end;
66
    }
67
68
    /**
69
     * @return string[]
70
     */
71
    public function tagIds(): array
72
    {
73
        return $this->tagIds;
74
    }
75
76
    public function toArray(): array
77
    {
78
        return [
79
            'start' => $this->start,
80
            'billable' => $this->billable,
81
            'description' => $this->description,
82
            'projectId' => $this->projectId,
83
            'taskId' => $this->taskId,
84
            'end' => $this->end,
85
            'tagIds' => $this->tagIds,
86
        ];
87
    }
88
}
89