| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | final class Timestamp implements Value |
||
| 19 | { |
||
| 20 | private $value; |
||
| 21 | private $original; |
||
| 22 | |||
| 23 | 14 | public function __construct(PointInTimeInterface $point) |
|
| 24 | { |
||
| 25 | 14 | $this->original = $point; |
|
| 26 | 14 | } |
|
| 27 | |||
| 28 | 8 | public static function fromStream(Readable $stream): Value |
|
| 29 | { |
||
| 30 | 8 | $time = UnsignedLongLongInteger::fromStream($stream) |
|
| 31 | 8 | ->original() |
|
| 32 | 8 | ->value(); |
|
| 33 | |||
| 34 | 8 | return new self(new PointInTime( |
|
| 35 | 8 | \date((string) new ISO8601, $time) |
|
|
|
|||
| 36 | )); |
||
| 37 | } |
||
| 38 | |||
| 39 | 10 | public function original(): PointInTimeInterface |
|
| 42 | } |
||
| 43 | |||
| 44 | 12 | public function __toString(): string |
|
| 48 | ); |
||
| 49 | } |
||
| 51 |