Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | abstract class NetworkInfo |
||
9 | { |
||
10 | private $signal; |
||
11 | private $tx; |
||
12 | private $rx; |
||
13 | |||
14 | /** |
||
15 | * @param float $signal |
||
16 | * @param int $tx |
||
17 | * @param int $rx |
||
18 | * @throws InvalidValueException |
||
19 | */ |
||
20 | 31 | protected function __construct(float $signal, int $tx, int $rx) |
|
21 | { |
||
22 | 31 | $this->signal = $signal; |
|
23 | 31 | $this->tx = validate_uint32('Transmitted bytes', $tx); |
|
24 | 25 | $this->rx = validate_uint32('Recieved bytes', $rx); |
|
25 | } |
||
26 | |||
27 | 7 | public function getSignal(): float |
|
28 | { |
||
29 | 7 | return $this->signal; |
|
30 | } |
||
31 | |||
32 | 7 | public function getTx(): int |
|
33 | { |
||
34 | 7 | return $this->tx; |
|
35 | } |
||
36 | |||
37 | 7 | public function getRx(): int |
|
40 | } |
||
41 | } |
||
42 |