Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
18 | final class Timestamp implements Value |
||
19 | { |
||
20 | private $value; |
||
21 | private $original; |
||
22 | |||
23 | 7 | public function __construct(PointInTimeInterface $point) |
|
29 | 7 | } |
|
30 | |||
31 | 4 | public static function fromStream(Readable $stream): Value |
|
32 | { |
||
33 | 4 | $time = UnsignedLongLongInteger::fromStream($stream) |
|
34 | 4 | ->original() |
|
35 | 4 | ->value(); |
|
36 | |||
37 | 4 | return new self(new PointInTime( |
|
38 | 4 | \date((string) new ISO8601, $time) |
|
|
|||
39 | )); |
||
40 | } |
||
41 | |||
42 | 5 | public function original(): PointInTimeInterface |
|
45 | } |
||
46 | |||
47 | 6 | public function __toString(): string |
|
52 |