Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
26 | public function normalize(JsonRpcResponse $response) |
||
27 | { |
||
28 | if ($response->isNotification()) { |
||
29 | return null; |
||
30 | } |
||
31 | |||
32 | $data = [ |
||
33 | self::KEY_JSON_RPC => $response->getJsonRpc(), |
||
34 | self::KEY_ID => $response->getId() |
||
35 | ]; |
||
36 | |||
37 | if ($response->getError()) { |
||
38 | $data[self::KEY_ERROR] = $this->normalizeError( |
||
39 | $response->getError() |
||
40 | ); |
||
41 | } else { |
||
42 | $data[self::KEY_RESULT] = $response->getResult(); |
||
43 | } |
||
44 | |||
45 | return $data; |
||
46 | } |
||
67 |