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