Passed
Push — master ( df80bc...5cc7cd )
by Jérémy
03:15 queued 01:22
created

SummaryReportSettingsDto::fromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JDecool\Clockify\Model;
6
7
class SummaryReportSettingsDto
8
{
9
    private $group;
10
    private $subgroup;
11
12
    public static function fromArray(array $data): self
13
    {
14
        return new self(
15
            $data['group'],
16
            $data['subgroup']
17
        );
18
    }
19
20
    public function __construct(string $group, string $subgroup)
21
    {
22
        $this->group = $group;
23
        $this->subgroup = $subgroup;
24
    }
25
26
    public function group(): string
27
    {
28
        return $this->group;
29
    }
30
31
    public function subgroup(): string
32
    {
33
        return $this->subgroup;
34
    }
35
}
36