Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | final class UnsignedShortInteger implements Value |
||
15 | { |
||
16 | private static $definitionSet; |
||
17 | |||
18 | private $value; |
||
19 | private $original; |
||
20 | |||
21 | 113 | public function __construct(Integer $value) |
|
22 | { |
||
23 | 113 | $this->original = $value; |
|
24 | 113 | } |
|
25 | |||
26 | 64 | public static function fromStream(Readable $stream): Value |
|
27 | { |
||
28 | 64 | [, $value] = unpack('n', (string) $stream->read(2)); |
|
29 | |||
30 | 64 | return new self(new Integer($value)); |
|
31 | } |
||
32 | |||
33 | 75 | public function original(): Integer |
|
34 | { |
||
35 | 75 | return $this->original; |
|
36 | } |
||
37 | |||
38 | 112 | public function __toString(): string |
|
41 | } |
||
42 | |||
43 | 1 | public static function definitionSet(): Set |
|
44 | { |
||
51 |