Passed
Push — master ( f9c14b...c6fe8b )
by Laurens
02:03
created

Structure   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 121
Duplicated Lines 0 %

Test Coverage

Coverage 93.1%

Importance

Changes 0
Metric Value
dl 0
loc 121
ccs 27
cts 29
cp 0.931
rs 10
c 0
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A isRhrEnrollment() 0 3 1
A __construct() 0 20 1
A getAway() 0 3 1
A getThermostats() 0 3 1
A getProtects() 0 3 1
A getCountryCode() 0 3 1
A getTimeZone() 0 3 1
A getCameras() 0 3 1
A getStructureId() 0 3 1
A getName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\NestApi\Client;
6
7
use DateTimeZone;
8
use LauLamanApps\NestApi\Client\Structure\Away;
9
use LauLamanApps\NestApi\Client\Structure\CameraProxy;
10
use LauLamanApps\NestApi\Client\Structure\ProtectProxy;
11
use LauLamanApps\NestApi\Client\Structure\ThermostatProxy;
12
13
final class Structure
14
{
15
    /**
16
     * @var string
17
     */
18
    private $structureId;
19
20
    /**
21
     * @var string
22
     */
23
    private $name;
24
25
    /**
26
     * @var ThermostatProxy[]
27
     */
28
    private $thermostats;
29
30
    /**
31
     * @var ProtectProxy[]
32
     */
33
    private $smokeCoAlarms;
34
35
    /**
36
     * @var CameraProxy[]
37
     */
38
    private $cameras;
39
40
    /**
41
     * @var string
42
     */
43
    private $countryCode;
44
45
    /**
46
     * @var DateTimeZone
47
     */
48
    private $timeZone;
49
50
    /**
51
     * @var Away
52
     */
53
    private $away;
54
55
    /**
56
     * @var bool
57
     */
58
    private $rhrEnrollment;
59
60 5
    public function __construct(
61
        string $structureId,
62
        string $name,
63
        array $thermostats,
64
        array $smokeCoAlarms,
65
        array $cameras,
66
        string $countryCode,
67
        DateTimeZone $timeZone,
68
        Away $away,
69
        bool $rhrEnrollment
70
    ) {
71 5
        $this->structureId = $structureId;
72 5
        $this->name = $name;
73 5
        $this->thermostats = $thermostats;
74 5
        $this->smokeCoAlarms = $smokeCoAlarms;
75 5
        $this->cameras = $cameras;
76 5
        $this->countryCode = $countryCode;
77 5
        $this->timeZone = $timeZone;
78 5
        $this->away = $away;
79 5
        $this->rhrEnrollment = $rhrEnrollment;
80 5
    }
81
82 4
    public function getStructureId(): string
83
    {
84 4
        return $this->structureId;
85
    }
86
87 5
    public function getName(): string
88
    {
89 5
        return $this->name;
90
    }
91
92
    /**
93
     * @return ThermostatProxy[]
94
     */
95 2
    public function getThermostats(): array
96
    {
97 2
        return $this->thermostats;
98
    }
99
100
    /**
101
     * @return ProtectProxy[]
102
     */
103 2
    public function getProtects(): array
104
    {
105 2
        return $this->smokeCoAlarms;
106
    }
107
108
    /**
109
     * @return CameraProxy[]
110
     */
111 2
    public function getCameras(): array
112
    {
113 2
        return $this->cameras;
114
    }
115
116 4
    public function getCountryCode(): string
117
    {
118 4
        return $this->countryCode;
119
    }
120
121 4
    public function getTimeZone(): DateTimeZone
122
    {
123 4
        return $this->timeZone;
124
    }
125
126 4
    public function getAway(): Away
127
    {
128 4
        return $this->away;
129
    }
130
131
    public function isRhrEnrollment(): bool
132
    {
133
        return $this->rhrEnrollment;
134
    }
135
}
136