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