1 | <?php declare(strict_types=1); |
||
9 | final class Document |
||
10 | { |
||
11 | /** |
||
12 | * @var ResponseInterface |
||
13 | */ |
||
14 | private $response; |
||
15 | |||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $expiresAt; |
||
20 | |||
21 | public static function createFromString(string $json): self |
||
35 | |||
36 | public static function createFromResponse(ResponseInterface $response, int $ttl): self |
||
40 | |||
41 | private function __construct(ResponseInterface $response, int $expiresAt) |
||
46 | |||
47 | /** |
||
48 | * @return ResponseInterface |
||
49 | */ |
||
50 | public function getResponse(): ResponseInterface |
||
54 | |||
55 | /** |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function hasExpired(): bool |
||
62 | |||
63 | public function __toString(): string |
||
78 | } |
||
79 |