| Total Complexity | 5 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class ConditionalResponse implements ConditionalResponseInterface |
||
| 13 | { |
||
| 14 | /** @see https://tools.ietf.org/html/rfc7232#section-4.1 */ |
||
| 15 | private const HEADER_IN_304 = [ |
||
| 16 | 'Cache-Control', |
||
| 17 | 'Content-Location', |
||
| 18 | 'Date', |
||
| 19 | 'ETag', |
||
| 20 | 'Expires', |
||
| 21 | 'Vary', |
||
| 22 | ]; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritDoc} |
||
| 26 | */ |
||
| 27 | #[Override] |
||
| 28 | public function isModified(ResourceObject $ro, array $server): bool |
||
| 29 | { |
||
| 30 | return ! (isset($server['HTTP_IF_NONE_MATCH'], $ro->headers['ETag']) && $server['HTTP_IF_NONE_MATCH'] === $ro->headers['ETag']); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * {@inheritDoc} |
||
| 35 | */ |
||
| 36 | #[Override] |
||
| 49 | } |
||
| 50 | } |
||
| 51 |