Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function translate(ResponseInterface $response): Response |
||
27 | { |
||
28 | if ($this->transformed->contains($response)) { |
||
29 | return $this->transformed->get($response); |
||
30 | } |
||
31 | |||
32 | $sfResponse = (new Response( |
||
33 | (string) $response->body(), |
||
34 | $response->statusCode()->value(), |
||
35 | $this->translateHeaders($response->headers()) |
||
36 | )) |
||
37 | ->setProtocolVersion((string) $response->protocolVersion()); |
||
38 | $this->transformed = $this->transformed->put( |
||
39 | $response, |
||
40 | $sfResponse |
||
41 | ); |
||
42 | |||
43 | return $sfResponse; |
||
44 | } |
||
45 | |||
66 |