| Conditions | 5 |
| Paths | 5 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function __call($MsgType, $datas) |
||
| 20 | { |
||
| 21 | $MsgType = strtolower($MsgType); |
||
| 22 | |||
| 23 | $data = []; |
||
| 24 | $data['CreateTime'] = time(); |
||
| 25 | $data['MsgType'] = $MsgType; |
||
| 26 | |||
| 27 | $datas = reset($datas); |
||
| 28 | |||
| 29 | if ($MsgType == 'text') { |
||
| 30 | $data['Content'] = $datas['Content']; |
||
| 31 | } elseif ($MsgType == 'news') { |
||
| 32 | $data['ArticleCount'] = count($datas['item']); |
||
| 33 | $data['Articles'] = $datas; |
||
| 34 | } elseif ($MsgType == 'music') { |
||
| 35 | $data['Music'] = $datas; |
||
| 36 | } elseif ($MsgType == 'video') { |
||
| 37 | $data['Video'] = $datas; |
||
| 38 | } else { |
||
| 39 | $data[$MsgType] = $datas; |
||
| 40 | } |
||
| 41 | |||
| 42 | return $data; |
||
| 43 | } |
||
| 44 | } |
||
| 45 |