| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 1 | private function transfer304(ResourceObject $ro) |
|
| 52 | { |
||
| 53 | $mustGenerateHeaders = [ |
||
| 54 | 1 | 'Cache-Control', |
|
| 55 | 'Content-Location', |
||
| 56 | 'Date', |
||
| 57 | 'ETag', |
||
| 58 | 'Expires', |
||
| 59 | 'Vary', |
||
| 60 | ]; |
||
| 61 | |||
| 62 | // header |
||
| 63 | 1 | foreach ($ro->headers as $label => $value) { |
|
| 64 | 1 | if (! in_array($label, $mustGenerateHeaders, true)) { |
|
| 65 | continue; |
||
| 66 | } |
||
| 67 | |||
| 68 | 1 | header("{$label}: {$value}", false); |
|
| 69 | } |
||
| 70 | |||
| 71 | // code |
||
| 72 | 1 | http_response_code(304); |
|
| 73 | 1 | } |
|
| 75 |