Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | abstract class DeviceProxy |
||
16 | { |
||
17 | /** |
||
18 | * @var NestClientInterface |
||
19 | */ |
||
20 | private $__client; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $__deviceId; |
||
26 | |||
27 | /** |
||
28 | * @var null|Thermostat|Protect|Camera |
||
29 | */ |
||
30 | private $__device; |
||
31 | |||
32 | /** |
||
33 | * @return ThermostatProxy|ProtectProxy|CameraProxy |
||
34 | */ |
||
35 | 4 | public function __construct(NestClientInterface $client, $deviceId) |
|
36 | { |
||
37 | 4 | $this->__deviceId = $deviceId; |
|
38 | 4 | $this->__client = $client; |
|
39 | 4 | } |
|
40 | |||
41 | /** |
||
42 | * @return Thermostat|Protect|Camera |
||
43 | */ |
||
44 | abstract protected function __load(NestClientInterface $client, string $deviceId); |
||
45 | |||
46 | 4 | public function __call($method, $args) |
|
53 | } |
||
54 | } |
||
55 |