| Total Complexity | 5 |
| Total Lines | 56 |
| 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 | 7 | public function normalize(JsonRpcResponse $response) |
|
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param JsonRpcExceptionInterface $error |
||
| 51 | * |
||
| 52 | * @return array |
||
| 53 | */ |
||
| 54 | 2 | private function normalizeError(JsonRpcExceptionInterface $error) |
|
| 68 |