Item   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getStatusCn() 0 11 1
1
<?php
2
/**
3
 * This file is part of the mucts.com.
4
 *
5
 * This source file is subject to the MIT license that is bundled
6
 * with this source code in the file LICENSE.
7
 *
8
 * @version 1.0
9
 * @author herry<[email protected]>
10
 * @copyright © 2020  MuCTS.com All Rights Reserved.
11
 */
12
13
namespace MuCTS\Sobot\OnlineService\ChatConnect\Response;
14
15
16
use MuCTS\Sobot\Contracts\Response;
17
18
/**
19
 * Class Item
20
 * @property-read int $status  状态:-1.重复请求,拒绝处理,0.排队,1.成功 2.无客服 3.在黑名单
21
 * @property-read string $status_cn 状态
22
 * @property-read string $agent_name  客服姓名
23
 * @property-read string $agent_face  客服头像
24
 * @property-read string $agentid  客服id
25
 * @property-read string $visitorid  用户id
26
 * @property-read string $cid  会话id
27
 * @property-read int $count  排队位置
28
 * @package MuCTS\Sobot\OnlineService\ChatConnect\Response
29
 */
30
class Item extends Response
31
{
32
    /**
33
     * 状态
34
     * @return string
35
     */
36
    public function getStatusCn()
37
    {
38
        $status = $this->status;
39
        $statusCn = [
40
            -1 => '重复请求,拒绝处理',
41
            0 => '排队',
42
            1 => '成功',
43
            2 => '无客服',
44
            3 => '在黑名单'
45
        ];
46
        return $statusCn[$status] ?? '未知';
47
    }
48
}