Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | 12 | public function getBody() |
|
41 | { |
||
42 | 12 | $body = json_decode($this->response->getBody(), true); |
|
43 | |||
44 | 12 | if (!$body) { |
|
45 | 3 | throw new ResponseWithoutBody('Response without body'); |
|
46 | } |
||
47 | |||
48 | 9 | if (!$this->transformer) { |
|
49 | 6 | return $body; |
|
50 | } |
||
51 | |||
52 | 3 | return $this->transformer->transformData($body); |
|
53 | } |
||
54 | } |
||
55 |