Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
9 | final class FrameAddress |
||
10 | { |
||
11 | public const WIRE_SIZE = 16; |
||
12 | |||
13 | private $target; |
||
14 | private $ackRequired; |
||
15 | private $responseRequired; |
||
16 | private $sequenceNo; |
||
17 | |||
18 | /** |
||
19 | * @param MacAddress $target |
||
20 | * @param bool $ackRequired |
||
21 | * @param bool $responseRequired |
||
22 | * @param int $sequenceNo |
||
23 | * @throws InvalidValueException |
||
24 | */ |
||
25 | 40 | public function __construct(MacAddress $target, bool $ackRequired, bool $responseRequired, int $sequenceNo) |
|
26 | { |
||
27 | 40 | $this->target = $target; |
|
28 | 40 | $this->ackRequired = $ackRequired; |
|
29 | 40 | $this->responseRequired = $responseRequired; |
|
30 | 40 | $this->sequenceNo = validate_uint8('Sequence number', $sequenceNo); |
|
31 | } |
||
32 | |||
33 | 22 | public function getTarget(): MacAddress |
|
36 | } |
||
37 | |||
38 | 21 | public function isAckRequired(): bool |
|
41 | } |
||
42 | |||
43 | 21 | public function isResponseRequired(): bool |
|
44 | { |
||
45 | 21 | return $this->responseRequired; |
|
46 | } |
||
47 | |||
48 | 21 | public function getSequenceNo(): int |
|
51 | } |
||
52 | } |
||
53 |