| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 93.75% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | final class UnsignedLongLongInteger implements Value |
||
| 19 | { |
||
| 20 | private static $definitionSet; |
||
| 21 | |||
| 22 | private $value; |
||
| 23 | private $original; |
||
| 24 | |||
| 25 | 47 | public function __construct(Integer $value) |
|
| 26 | { |
||
| 27 | 47 | if (!self::definitionSet()->contains($value)) { |
|
| 28 | 1 | throw new OutOfRangeValue($value, self::definitionSet()); |
|
| 29 | } |
||
| 30 | |||
| 31 | 46 | $this->original = $value; |
|
| 32 | 46 | } |
|
| 33 | |||
| 34 | 28 | public static function fromStream(Readable $stream): Value |
|
| 35 | { |
||
| 36 | 28 | [, $value] = unpack('J', (string) $stream->read(8)); |
|
| 37 | |||
| 38 | 28 | return new self(new Integer($value)); |
|
| 39 | } |
||
| 40 | |||
| 41 | 34 | public function original(): Integer |
|
| 42 | { |
||
| 43 | 34 | return $this->original; |
|
| 44 | } |
||
| 45 | |||
| 46 | 45 | public function __toString(): string |
|
| 49 | } |
||
| 50 | |||
| 51 | 47 | public static function definitionSet(): Set |
|
| 52 | { |
||
| 59 |