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