Client   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
eloc 9
c 3
b 0
f 1
dl 0
loc 41
ccs 0
cts 8
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setGlobalNoSpeaking() 0 9 1
A getGlobalNoSpeaking() 0 7 1
1
<?php
2
3
namespace EasyIM\TencentIM\Speak;
4
5
use EasyIM\Kernel\BaseClient;
6
7
/**
8
 * Class Client
9
 *
10
 * @package EasyIM\TencentIM\Speak
11
 * @author  longing <[email protected]>
12
 */
13
class Client extends BaseClient
14
{
15
    /**
16
     *
17
     * Query user forbidden words.
18
     *
19
     * @param string $account
20
     *
21
     * @return array|\EasyIM\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
22
     * @throws \EasyIM\Kernel\Exceptions\InvalidConfigException
23
     * @throws \GuzzleHttp\Exception\GuzzleException
24
     */
25
    public function getGlobalNoSpeaking(string $account)
26
    {
27
        $params = [
28
            'Get_Account' => $account
29
        ];
30
31
        return $this->httpPostJson('openconfigsvr/getnospeaking', $params);
32
    }
33
34
    /**
35
     * Set user forbidden words.
36
     *
37
     * @param string $account
38
     * @param int    $c2cMsgNoSpeakingTime
39
     * @param int    $groupMsgNoSpeakingTime
40
     *
41
     * @return array|\EasyIM\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
42
     * @throws \EasyIM\Kernel\Exceptions\InvalidConfigException
43
     * @throws \GuzzleHttp\Exception\GuzzleException
44
     */
45
    public function setGlobalNoSpeaking(string $account, int $c2cMsgNoSpeakingTime = 0, int $groupMsgNoSpeakingTime = 0)
46
    {
47
        $params = [
48
            'Set_Account' => $account,
49
            'C2CmsgNospeakingTime' => $c2cMsgNoSpeakingTime,
50
            'GroupmsgNospeakingTime' => $groupMsgNoSpeakingTime,
51
        ];
52
53
        return $this->httpPostJson('openconfigsvr/setnospeaking', $params);
54
    }
55
}
56