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

ClientDto   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
dl 0
loc 35
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A workspaceId() 0 3 1
A name() 0 3 1
A fromArray() 0 6 1
A id() 0 3 1
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