Recent   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 99
rs 10
c 0
b 0
f 0
wmc 7
lcom 1
cbo 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
A setType() 0 4 1
A getUin() 0 4 1
A setUin() 0 4 1
A isFriendType() 0 4 1
A isGroupType() 0 4 1
A isDiscussType() 0 4 1
1
<?php
2
/*
3
 * This file is part of the slince/smartqq package.
4
 *
5
 * (c) Slince <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Slince\SmartQQ\Entity;
12
13
class Recent
14
{
15
    /**
16
     * 好友会话.
17
     *
18
     * @var int
19
     */
20
    const TYPE_FRIEND = 0;
21
22
    /**
23
     * 群会话.
24
     *
25
     * @var int
26
     */
27
    const TYPE_GROUP = 1;
28
29
    /**
30
     * 讨论组会话.
31
     *
32
     * @var int
33
     */
34
    const TYPE_DISCUSS = 2;
35
36
    /**
37
     * 会话类型.
38
     *
39
     * @var int
40
     */
41
    protected $type;
42
43
    /**
44
     * 对方编号.
45
     *
46
     * @var int
47
     */
48
    protected $uin;
49
50
    /**
51
     * @return int
52
     */
53
    public function getType()
54
    {
55
        return $this->type;
56
    }
57
58
    /**
59
     * @param int $type
60
     */
61
    public function setType($type)
62
    {
63
        $this->type = $type;
64
    }
65
66
    /**
67
     * @return int
68
     */
69
    public function getUin()
70
    {
71
        return $this->uin;
72
    }
73
74
    /**
75
     * @param int $uin
76
     */
77
    public function setUin($uin)
78
    {
79
        $this->uin = $uin;
80
    }
81
82
    /**
83
     * 是否是好友会话.
84
     *
85
     * @return bool
86
     */
87
    public function isFriendType()
88
    {
89
        return $this->type == static::TYPE_FRIEND;
90
    }
91
92
    /**
93
     * 是否是群会话.
94
     *
95
     * @return bool
96
     */
97
    public function isGroupType()
98
    {
99
        return $this->type == static::TYPE_GROUP;
100
    }
101
102
    /**
103
     * 是否是讨论组会话.
104
     *
105
     * @return bool
106
     */
107
    public function isDiscussType()
108
    {
109
        return $this->type == static::TYPE_DISCUSS;
110
    }
111
}
112