NetworkInfo::getRx()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\LibLifxLan\DataTypes;
4
5
use DaveRandom\LibLifxLan\Exceptions\InvalidValueException;
6
use function DaveRandom\LibLifxLan\validate_uint32;
7
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
38
    {
39 7
        return $this->rx;
40
    }
41
}
42