Item::getStatusCn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
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\ChatSend\Response;
14
15
16
use MuCTS\Sobot\Contracts\Response;
17
18
/**
19
 * Class Item
20
 * @property-read int $status 状态:1.成功 2.用户没有跟客服建立连接
21
 * @property-read string $status_cn
22
 * @package MuCTS\Sobot\OnlineService\ChatSend\Response
23
 */
24
class Item extends Response
25
{
26
    /**
27
     * 状态
28
     * @return string
29
     */
30
    public function getStatusCn()
31
    {
32
        $status = $this->status;
33
        $statusCn = [
34
            1 => '成功',
35
            2 => '用户没有跟客服建立连接'
36
        ];
37
        return $statusCn[$status] ?? '未知';
38
    }
39
}