Completed
Push — master ( ba407f...6dbf2d )
by Chris
02:29
created

Group::setLabel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 4
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\LibLifxLan\DataTypes;
4
5
use Ramsey\Uuid\UuidInterface;
6
use function DaveRandom\LibLifxLan\datetimeinterface_to_datetimeimmutable;
7
8 View Code Duplication
final class Group
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    private $guid;
11
    private $label;
12
    private $updatedAt;
13
14
    private function setGuid(UuidInterface $guid): void
15
    {
16
        $this->guid = $guid;
17
    }
18
19
    private function setLabel(Label $label): void
20
    {
21
        $this->label = $label;
22
    }
23
24
    private function setUpdatedAt(\DateTimeImmutable $updatedAt): void
25
    {
26
        $this->updatedAt = $updatedAt;
27
    }
28
29
    public function __construct(UuidInterface $guid, Label $label, \DateTimeInterface $updatedAt)
30
    {
31
        $this->setGuid($guid);
32
        $this->setLabel($label);
33
        $this->setUpdatedAt(datetimeinterface_to_datetimeimmutable($updatedAt));
34
    }
35
36
    public function getGuid(): UuidInterface
37
    {
38
        return $this->guid;
39
    }
40
41
    public function getLabel(): Label
42
    {
43
        return $this->label;
44
    }
45
46
    public function getUpdatedAt(): \DateTimeImmutable
47
    {
48
        return $this->updatedAt;
49
    }
50
}
51