Category   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 88
rs 10
c 0
b 0
f 0
wmc 8
lcom 0
cbo 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setName() 0 4 1
A setIndex() 0 4 1
A setSort() 0 4 1
A getName() 0 4 1
A getIndex() 0 4 1
A getSort() 0 4 1
A createMyFriendCategory() 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
/**
14
 * QQ好友分组.
15
 */
16
class Category
17
{
18
    /**
19
     * 分组名称.
20
     *
21
     * @var string
22
     */
23
    protected $name;
24
25
    /**
26
     * 编号,作用不明.
27
     *
28
     * @var int
29
     */
30
    protected $index;
31
32
    /**
33
     * 顺序.
34
     *
35
     * @var int
36
     */
37
    protected $sort;
38
39
    public function __construct($name, $index = 0, $sort = 0)
40
    {
41
        $this->name = $name;
42
        $this->index = $index;
43
        $this->sort = $sort;
44
    }
45
46
    /**
47
     * @param string $name
48
     */
49
    public function setName($name)
50
    {
51
        $this->name = $name;
52
    }
53
54
    /**
55
     * @param int $index
56
     */
57
    public function setIndex($index)
58
    {
59
        $this->index = $index;
60
    }
61
62
    /**
63
     * @param mixed $sort
64
     */
65
    public function setSort($sort)
66
    {
67
        $this->sort = $sort;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getName()
74
    {
75
        return $this->name;
76
    }
77
78
    /**
79
     * @return int
80
     */
81
    public function getIndex()
82
    {
83
        return $this->index;
84
    }
85
86
    /**
87
     * @return mixed
88
     */
89
    public function getSort()
90
    {
91
        return $this->sort;
92
    }
93
94
    /**
95
     * 创建我的好友默认分类.
96
     *
97
     * @return Category
98
     */
99
    public static function createMyFriendCategory()
100
    {
101
        return new static('我的好友', 0, 0);
102
    }
103
}
104