| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0625 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | 3 | public function headers($contentType): void |
|
| 15 | { |
||
| 16 | 3 | $response = $this->getActionController()->getResponse(); |
|
| 17 | 3 | $response->setHeader('Content-Type', $contentType); |
|
| 18 | 3 | $response->setHeader('Cache-Control', 'max-age=604800'); |
|
| 19 | |||
| 20 | // This check is required when running via unit tests |
||
| 21 | 3 | if (headers_sent()) { |
|
| 22 | 3 | return; |
|
| 23 | } |
||
| 24 | |||
| 25 | header_remove('Pragma'); |
||
| 26 | header_remove('Expires'); |
||
| 27 | } |
||
| 39 |