Chat   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A history() 0 13 2
1
<?php
2
3
/*
4
 * This file is part of the light/easemob.
5
 *
6
 * (c) lichunqiang <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace light\Easemob\Rest;
13
14
class Chat extends Rest
15
{
16
    /**
17
     * 获取历史聊天记录.
18
     *
19
     * @param null|string $cursor
20
     * @param null|string $sql
21
     * @param int         $limit
22
     *
23
     * @throws \light\Easemob\Exception\EasemobException
24
     *
25
     * @return array
26
     */
27
    public function history($cursor = null, $sql = null, $limit = 20)
28
    {
29
        $response = $this->get('chatmessages', [
30
            'limit' => $limit,
31
            'cursor' => $cursor,
32
            'sql' => $sql,
33
        ]);
34
35
        return [
36
            'items' => $response['entities'],
37
            'cursor' => isset($response['cursor']) ? $response['cursor'] : null,
38
        ];
39
    }
40
}
41