1 | <?php declare(strict_types=1); |
||
9 | final class Frame |
||
10 | { |
||
11 | public const WIRE_SIZE = 8; |
||
12 | |||
13 | private $size; |
||
14 | private $origin; |
||
15 | private $tagged; |
||
16 | private $addressable; |
||
17 | private $protocolNo; |
||
18 | private $source; |
||
19 | |||
20 | /** |
||
21 | * @param int $size |
||
22 | * @throws InvalidValueException |
||
23 | */ |
||
24 | 29 | private function setSize(int $size): void |
|
32 | |||
33 | /** |
||
34 | * @param int $origin |
||
35 | * @throws InvalidValueException |
||
36 | */ |
||
37 | 25 | private function setOrigin(int $origin): void |
|
45 | |||
46 | 21 | private function setTagged(bool $tagged): void |
|
50 | |||
51 | 21 | private function setAddressable(bool $addressable): void |
|
55 | |||
56 | /** |
||
57 | * @param int $protocolNo |
||
58 | * @throws InvalidValueException |
||
59 | */ |
||
60 | 21 | private function setProtocolNo(int $protocolNo): void |
|
68 | |||
69 | /** |
||
70 | * @param int $source |
||
71 | * @throws InvalidValueException |
||
72 | */ |
||
73 | 17 | private function setSource(int $source): void |
|
83 | |||
84 | /** |
||
85 | * @param int $size |
||
86 | * @param int $origin |
||
87 | * @param bool $tagged |
||
88 | * @param bool $addressable |
||
89 | * @param int $protocolNo |
||
90 | * @param int $source |
||
91 | * @throws InvalidValueException |
||
92 | */ |
||
93 | 29 | public function __construct(int $size, int $origin, bool $tagged, bool $addressable, int $protocolNo, int $source) |
|
102 | |||
103 | 2 | public function getSize(): int |
|
107 | |||
108 | 2 | public function getOrigin(): int |
|
112 | |||
113 | 2 | public function isTagged(): bool |
|
117 | |||
118 | 2 | public function isAddressable(): bool |
|
122 | |||
123 | 2 | public function getProtocolNo(): int |
|
127 | |||
128 | 2 | public function getSource(): int |
|
132 | } |
||
133 |