Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
17 | final class UnsignedOctet implements Value |
||
18 | { |
||
19 | private static $definitionSet; |
||
20 | |||
21 | private $value; |
||
22 | private $original; |
||
23 | |||
24 | 137 | public function __construct(Integer $octet) |
|
25 | { |
||
26 | 137 | $this->original = $octet; |
|
27 | 137 | } |
|
28 | |||
29 | 82 | public static function fromStream(Readable $stream): Value |
|
30 | { |
||
31 | 82 | [, $octet] = unpack('C', (string) $stream->read(1)); |
|
32 | |||
33 | 82 | return new self(new Integer($octet)); |
|
34 | } |
||
35 | |||
36 | 84 | public function original(): Integer |
|
37 | { |
||
38 | 84 | return $this->original; |
|
39 | } |
||
40 | |||
41 | 136 | public function __toString(): string |
|
44 | } |
||
45 | |||
46 | 1 | public static function definitionSet(): Set |
|
51 | ); |
||
52 | } |
||
54 |