| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 62.5% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | 14 | final readonly class HttpCache implements HttpCacheInterface, DeprecatedHttpCacheInterface |
|
|
|
|||
| 15 | { |
||
| 16 | 14 | public function __construct( |
|
| 17 | 14 | private ResourceStorageInterface $storage, |
|
| 18 | ) { |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | 2 | * {@inheritDoc} |
|
| 23 | */ |
||
| 24 | 2 | #[Override] |
|
| 25 | public function isNotModified(array $server): bool |
||
| 26 | { |
||
| 27 | return isset($server[Header::HTTP_IF_NONE_MATCH]) && $this->storage->hasEtag($server[Header::HTTP_IF_NONE_MATCH]); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritDoc} |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | */ |
||
| 35 | #[Override] |
||
| 36 | public function transfer() |
||
| 37 | { |
||
| 38 | // @codeCoverageIgnoreStart |
||
| 39 | http_response_code(304); |
||
| 40 | // @codeCoverageIgnoreEnd |
||
| 43 |