Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | final class LongString implements Value |
||
12 | { |
||
13 | private $value; |
||
14 | private $original; |
||
15 | |||
16 | 62 | public function __construct(Str $string) |
|
19 | 62 | } |
|
20 | |||
21 | 56 | public static function fromStream(Readable $stream): Value |
|
22 | { |
||
23 | 56 | $length = UnsignedLongInteger::fromStream($stream)->original(); |
|
24 | |||
25 | 56 | return new self($stream->read($length->value())); |
|
26 | } |
||
27 | |||
28 | 8 | public function original(): Str |
|
29 | { |
||
30 | 8 | return $this->original; |
|
31 | } |
||
32 | |||
33 | 64 | public function __toString(): string |
|
38 | } |
||
39 | } |
||
40 |