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