Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class ResponseNormalizer |
||
11 | { |
||
12 | const KEY_JSON_RPC = 'json-rpc'; |
||
13 | const KEY_ID = 'id'; |
||
14 | const KEY_RESULT = 'result'; |
||
15 | const KEY_ERROR = 'error'; |
||
16 | |||
17 | const SUB_KEY_ERROR_CODE = 'code'; |
||
18 | const SUB_KEY_ERROR_MESSAGE = 'message'; |
||
19 | const SUB_KEY_ERROR_DATA = 'data'; |
||
20 | |||
21 | /** |
||
22 | * @param JsonRpcResponse $response |
||
23 | * |
||
24 | * @return array|null |
||
25 | */ |
||
26 | 4 | public function normalize(JsonRpcResponse $response) |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param JsonRpcExceptionInterface $error |
||
50 | * |
||
51 | * @return array |
||
52 | */ |
||
53 | 2 | private function normalizeError(JsonRpcExceptionInterface $error) |
|
67 |