| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 47 | 3 | public function createResponse(string $format, FormatterInterface $formatter, FeedInterface $feed) : ResponseInterface |
|
| 48 | { |
||
| 49 | $headers = [ |
||
| 50 | 3 | 'Content-Type' => ($format === 'json') ? 'application/json':'application/xhtml+xml', |
|
| 51 | 3 | 'Cache-Control' => ($this->public ? 'public':'private') . ", max-age={$this->maxAge}", |
|
| 52 | 3 | 'Last-Modified' => $feed->getLastModified()->format(\DateTime::RSS), |
|
| 53 | ]; |
||
| 54 | |||
| 55 | 3 | return new Response(200, $headers, $formatter->toString($feed)); |
|
| 56 | } |
||
| 57 | } |
||
| 58 |