Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function modify(Response $response, Request $request): Response |
||
32 | { |
||
33 | $acceptableContentTypes = $request->getAcceptableContentTypes(); |
||
34 | |||
35 | foreach ($acceptableContentTypes as $contentType) { |
||
36 | if ($contentType === $this->responseContentType) { |
||
37 | $clone = clone $response; |
||
38 | $clone->headers->set('Content-Type', $contentType); |
||
39 | |||
40 | return $clone; |
||
41 | } |
||
42 | } |
||
43 | |||
44 | return $response; |
||
45 | } |
||
46 | } |
||
47 |