Passed
Push — master ( 8634b9...ba407f )
by Chris
14:07
created

TimeInfo   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getTime() 0 4 1
A getUptime() 0 4 1
A getDowntime() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\LibLifxLan\DataTypes;
4
5
use function DaveRandom\LibLifxLan\datetimeinterface_to_datetimeimmutable;
6
7
final class TimeInfo
8
{
9
    private $time;
10
    private $uptime;
11
    private $downtime;
12
13
    public function __construct(\DateTimeInterface $time, int $uptime, int $downtime)
14
    {
15
        $this->time = datetimeinterface_to_datetimeimmutable($time);
16
        $this->uptime = $uptime;
17
        $this->downtime = $downtime;
18
    }
19
20
    public function getTime(): \DateTimeImmutable
21
    {
22
        return $this->time;
23
    }
24
25
    public function getUptime(): int
26
    {
27
        return $this->uptime;
28
    }
29
30
    public function getDowntime(): int
31
    {
32
        return $this->downtime;
33
    }
34
}
35