Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | protected function _parseResponse($result) |
||
39 | { |
||
40 | $result = json_decode($result, true); |
||
41 | // @codeCoverageIgnoreStart |
||
42 | if (!$result || !isset($result['errNum'])) { |
||
43 | return ['errcode' => 1, 'errmsg' => 'fetch data error']; |
||
44 | } |
||
45 | // @codeCoverageIgnoreEnd |
||
46 | if ($result['errNum'] == 0) { |
||
47 | return [ |
||
48 | 'errcode' => 0, |
||
49 | 'errmsg' => 'success', |
||
50 | 'data' => $result['retData'], |
||
51 | ]; |
||
52 | } |
||
53 | |||
54 | return ['errcode' => $result['errNum'], 'errmsg' => $result['retMsg']]; |
||
55 | } |
||
56 | } |
||
57 |