| 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 | 38 | public function __construct(MacAddress $target, bool $ackRequired, bool $responseRequired, int $sequenceNo) |
|
| 26 | { |
||
| 27 | 38 | $this->target = $target; |
|
| 28 | 38 | $this->ackRequired = $ackRequired; |
|
| 29 | 38 | $this->responseRequired = $responseRequired; |
|
| 30 | 38 | $this->sequenceNo = validate_uint8('Sequence number', $sequenceNo); |
|
| 31 | } |
||
| 32 | |||
| 33 | 20 | public function getTarget(): MacAddress |
|
| 36 | } |
||
| 37 | |||
| 38 | 19 | public function isAckRequired(): bool |
|
| 41 | } |
||
| 42 | |||
| 43 | 19 | public function isResponseRequired(): bool |
|
| 44 | { |
||
| 45 | 19 | return $this->responseRequired; |
|
| 46 | } |
||
| 47 | |||
| 48 | 19 | public function getSequenceNo(): int |
|
| 51 | } |
||
| 52 | } |
||
| 53 |