Completed
Push — master ( 026b2f...fbea6a )
by Taosikai
11:48
created

src/Entity/GroupDetail.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
use Slince\SmartQQ\EntityCollection;
14
15
class GroupDetail
16
{
17
    /**
18
     * 组id.
19
     *
20
     * @var int
21
     */
22
    protected $gid;
23
24
    /**
25
     * 群名称.
26
     *
27
     * @var string
28
     */
29
    protected $name;
30
31
    /**
32
     * code.
33
     *
34
     * @var string
35
     */
36
    protected $code;
37
38
    /**
39
     * 创建者的编号.
40
     *
41
     * @var int
42
     */
43
    protected $owner;
44
45
    /**
46
     * 群等级.
47
     *
48
     * @var int
49
     */
50
    protected $level;
51
52
    /**
53
     * 创建时间.
54
     *
55
     * @var int
56
     */
57
    protected $createTime;
58
59
    /**
60
     * flag.
61
     *
62
     * @var int
63
     */
64
    protected $flag;
65
66
    /**
67
     * 群公告.
68
     *
69
     * @var string
70
     */
71
    protected $memo;
72
73
    /**
74
     * @var EntityCollection
75
     */
76
    protected $members;
77
78
    /**
79
     * @return int
80
     */
81
    public function getGid()
82
    {
83
        return $this->gid;
84
    }
85
86
    /**
87
     * @param int $gid
88
     */
89
    public function setGid($gid)
90
    {
91
        $this->gid = $gid;
92
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function getName()
98
    {
99
        return $this->name;
100
    }
101
102
    /**
103
     * @param string $name
104
     */
105
    public function setName($name)
106
    {
107
        $this->name = $name;
108
    }
109
110
    /**
111
     * @return string
112
     */
113
    public function getCode()
114
    {
115
        return $this->code;
116
    }
117
118
    /**
119
     * @param string $code
120
     */
121
    public function setCode($code)
122
    {
123
        $this->code = $code;
124
    }
125
126
    /**
127
     * @return int
128
     */
129
    public function getOwner()
130
    {
131
        return $this->owner;
132
    }
133
134
    /**
135
     * @param int $owner
136
     */
137
    public function setOwner($owner)
138
    {
139
        $this->owner = $owner;
140
    }
141
142
    /**
143
     * @return int
144
     */
145
    public function getLevel()
146
    {
147
        return $this->level;
148
    }
149
150
    /**
151
     * @param int $level
152
     */
153
    public function setLevel($level)
154
    {
155
        $this->level = $level;
156
    }
157
158
    /**
159
     * @return int
160
     */
161
    public function getCreateTime()
162
    {
163
        return $this->createTime;
164
    }
165
166
    /**
167
     * @param int $createTime
168
     */
169
    public function setCreateTime($createTime)
170
    {
171
        $this->createTime = $createTime;
172
    }
173
174
    /**
175
     * @return int
176
     */
177
    public function getFlag()
178
    {
179
        return $this->flag;
180
    }
181
182
    /**
183
     * @param int $flag
184
     */
185
    public function setFlag($flag)
186
    {
187
        $this->flag = $flag;
188
    }
189
190
    /**
191
     * @return string
192
     */
193
    public function getMemo()
194
    {
195
        return $this->memo;
196
    }
197
198
    /**
199
     * @param string $memo
200
     */
201
    public function setMemo($memo)
202
    {
203
        $this->memo = $memo;
204
    }
205
206
    /**
207
     * @return EntityCollection|GroupMember[]
208
     */
209
    public function getMembers()
210
    {
211
        return $this->members;
212
    }
213
214
    /**
215
     * @param EntityCollection|GroupMember[] $members
216
     */
217
    public function setMembers($members)
218
    {
219
        $this->members = $members;
0 ignored issues
show
Documentation Bug introduced by
It seems like $members can also be of type array<integer,object<Sli...QQ\Entity\GroupMember>>. However, the property $members is declared as type object<Slince\SmartQQ\EntityCollection>. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
220
    }
221
}
222