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 | 7 | public function __construct(PointInTimeInterface $point) |
|
24 | { |
||
25 | 7 | $this->original = $point; |
|
26 | 7 | } |
|
27 | |||
28 | 4 | public static function fromStream(Readable $stream): Value |
|
29 | { |
||
30 | 4 | $time = UnsignedLongLongInteger::fromStream($stream) |
|
31 | 4 | ->original() |
|
32 | 4 | ->value(); |
|
33 | |||
34 | 4 | return new self(new PointInTime( |
|
35 | 4 | \date((string) new ISO8601, $time) |
|
|
|||
36 | )); |
||
37 | } |
||
38 | |||
39 | 5 | public function original(): PointInTimeInterface |
|
42 | } |
||
43 | |||
44 | 6 | public function __toString(): string |
|
48 | ); |
||
49 | } |
||
51 |