| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class ShortString implements Value |
||
| 12 | { |
||
| 13 | private $value; |
||
| 14 | private $original; |
||
| 15 | |||
| 16 | 194 | public function __construct(Str $string) |
|
| 19 | 194 | } |
|
| 20 | |||
| 21 | 136 | public static function of(Str $string): self |
|
| 22 | { |
||
| 23 | 136 | UnsignedOctet::of(new Integer($string->toEncoding('ASCII')->length())); |
|
| 24 | |||
| 25 | 134 | return new self($string); |
|
| 26 | } |
||
| 27 | |||
| 28 | 138 | public static function fromStream(Readable $stream): Value |
|
| 33 | } |
||
| 34 | |||
| 35 | 144 | public function original(): Str |
|
| 36 | { |
||
| 37 | 144 | return $this->original; |
|
| 38 | } |
||
| 39 | |||
| 40 | 192 | public function __toString(): string |
|
| 45 | } |
||
| 46 | } |
||
| 47 |