Passed
Push — master ( 881b80...a7445e )
by Jérémy
01:38
created

ClientDto::id()   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
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JDecool\Clockify\Model;
6
7
class ClientDto
8
{
9
    private $id;
10
    private $name;
11
    private $workspaceId;
12
13
    public static function fromArray(array $data): self
14
    {
15
        return new self(
16
            $data['id'],
17
            $data['name'],
18
            $data['workspaceId']
19
        );
20
    }
21
22
    public function __construct(string $id, string $name, string $workspaceId)
23
    {
24
        $this->id = $id;
25
        $this->name = $name;
26
        $this->workspaceId = $workspaceId;
27
    }
28
29
    public function id(): string
30
    {
31
        return $this->id;
32
    }
33
34
    public function name(): string
35
    {
36
        return $this->name;
37
    }
38
39
    public function workspaceId(): string
40
    {
41
        return $this->workspaceId;
42
    }
43
}
44