Test Failed
Push — master ( 67c9bb...4758b5 )
by
unknown
02:50 queued 38s
created

ChatMember::getCanPinMessages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
7
class ChatMember extends BaseType
8
{
9
    /**
10
     * {@inheritdoc}
11
     *
12
     * @var array
13
     */
14
    static protected $requiredParams = ['user', 'status'];
15
16
    /**
17
     * {@inheritdoc}
18
     *
19
     * @var array
20
     */
21
    static protected $map = [
22
        'user' => User::class,
23
        'status' => true,
24
        'until_date' => true,
25
        'can_be_edited' => true,
26
        'can_change_info' => true,
27
        'can_post_messages' => true,
28
        'can_edit_messages' => true,
29
        'can_delete_messages' => true,
30
        'can_invite_users' => true,
31
        'can_restrict_members' => true,
32
        'can_pin_messages' => true,
33
        'can_promote_members' => true,
34
        'can_send_messages' => true,
35
        'can_send_media_messages' => true,
36
        'can_send_other_messages' => true,
37
        'can_add_web_page_previews' => true
38
    ];
39
40
    /**
41
     * Information about the user
42
     *
43
     * @var User
44
     */
45
    protected $user;
46
47
    /**
48
     * The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
49
     *
50
     * @var string
51
     */
52
    protected $status;
53
54
    /**
55
     * Optional. Restictred and kicked only. Date when restrictions will be lifted for this user, unix time
56
     *
57
     * @var integer
58
     */
59
    protected $untilDate;
60
61
    /**
62
     * Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
63
     *
64
     * @var bool
65
     */
66
    protected $canBeEdited;
67
68
    /**
69
     * Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings
70
     *
71
     * @var bool
72
     */
73
    protected $canChangeInfo;
74
75
    /**
76
     * Optional. Administrators only. True, if the administrator can post in the channel, channels only
77
     *
78
     * @var bool
79
     */
80
    protected $canPostMessages;
81
82
    /**
83
     * Optional. Administrators only. True, if the administrator can edit messages of other users, channels only
84
     *
85
     * @var bool
86
     */
87
    protected $canEditMessages;
88
89
    /**
90
     * Optional. Administrators only. True, if the administrator can delete messages of other users
91
     *
92
     * @var bool
93
     */
94
    protected $canDeleteMessages;
95
96
    /**
97
     * Optional. Administrators only. True, if the administrator can invite new users to the chat
98
     *
99
     * @var bool
100
     */
101
    protected $canInviteUsers;
102
103
    /**
104
     * Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members
105
     *
106
     * @var bool
107
     */
108
    protected $canRestrictMembers;
109
110
    /**
111
     * Optional. Administrators only. True, if the administrator can pin messages, supergroups only
112
     *
113
     * @var bool
114
     */
115
    protected $canPinMessages;
116
117
    /**
118
     * Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own
119
     * privileges or demote administrators that he has promoted, directly or indirectly
120
     * (promoted by administrators that were appointed by the user)
121
     *
122
     * @var bool
123
     */
124
    protected $canPromoteMembers;
125
126
    /**
127
     * Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues
128
     *
129
     * @var bool
130
     */
131
    protected $canSendMessages;
132
133
    /**
134
     * Optional. Restricted only. True, if the user can send audios, documents, photos, videos, video notes
135
     * and voice notes, implies can_send_messages
136
     *
137
     * @var bool
138
     */
139
    protected $canSendMediaMessages;
140
141
    /**
142
     * Optional. Restricted only. True, if the user can send animations, games, stickers and use inline bots,
143
     * implies can_send_media_messages
144
     *
145
     * @var bool
146
     */
147
    protected $canSendOtherMessages;
148
149
    /**
150
     * Optional. Restricted only. True, if user may add web page previews to his messages,
151
     * implies can_send_media_messages
152
     *
153
     * @var bool
154
     */
155
    protected $canAddWebPagePreviews;
156
157
    /**
158
     * @return User
159
     */
160
    public function getUser()
161
    {
162
        return $this->user;
163
    }
164
165
    /**
166
     * @param User $user
167
     */
168
    public function setUser($user)
169
    {
170
        $this->user = $user;
171
    }
172
173
    /**
174
     * @return string
175
     */
176
    public function getStatus()
177
    {
178
        return $this->status;
179
    }
180
181
    /**
182
     * @param string $status
183
     */
184
    public function setStatus($status)
185
    {
186
        $this->status = $status;
187
    }
188
189
    /**
190
     * @return int
191
     */
192
    public function getUntilDate()
193
    {
194
        return $this->untilDate;
195
    }
196
197
    /**
198
     * @param int $untilDate
199
     */
200
    public function setUntilDate($untilDate)
201
    {
202
        $this->untilDate = $untilDate;
203
    }
204
205
    /**
206
     * @return bool
207
     */
208
    public function getCanBeEdited()
209
    {
210
        return $this->canBeEdited;
211
    }
212
213
    /**
214
     * @param bool $canBeEdited
215
     */
216
    public function setCanBeEdited($canBeEdited)
217
    {
218
        $this->canBeEdited = $canBeEdited;
219
    }
220
221
    /**
222
     * @return bool
223
     */
224
    public function getCanChangeInfo()
225
    {
226
        return $this->canChangeInfo;
227
    }
228
229
    /**
230
     * @param bool $canChangeInfo
231
     */
232
    public function setCanChangeInfo($canChangeInfo)
233
    {
234
        $this->canChangeInfo = $canChangeInfo;
235
    }
236
237
    /**
238
     * @return bool
239
     */
240
    public function getCanPostMessages()
241
    {
242
        return $this->canPostMessages;
243
    }
244
245
    /**
246
     * @param bool $canPostMessages
247
     */
248
    public function setCanPostMessages($canPostMessages)
249
    {
250
        $this->canPostMessages = $canPostMessages;
251
    }
252
253
    /**
254
     * @return bool
255
     */
256
    public function getCanEditMessages()
257
    {
258
        return $this->canEditMessages;
259
    }
260
261
    /**
262
     * @param bool $canEditMessages
263
     */
264
    public function setCanEditMessages($canEditMessages)
265
    {
266
        $this->canEditMessages = $canEditMessages;
267
    }
268
269
    /**
270
     * @return bool
271
     */
272
    public function getCanDeleteMessages()
273
    {
274
        return $this->canDeleteMessages;
275
    }
276
277
    /**
278
     * @param bool $canDeleteMessages
279
     */
280
    public function setCanDeleteMessages($canDeleteMessages)
281
    {
282
        $this->canDeleteMessages = $canDeleteMessages;
283
    }
284
285
    /**
286
     * @return bool
287
     */
288
    public function getCanInviteUsers()
289
    {
290
        return $this->canInviteUsers;
291
    }
292
293
    /**
294
     * @param bool $canInviteUsers
295
     */
296
    public function setCanInviteUsers($canInviteUsers)
297
    {
298
        $this->canInviteUsers = $canInviteUsers;
299
    }
300
301
    /**
302
     * @return bool
303
     */
304
    public function getCanRestrictMembers()
305
    {
306
        return $this->canRestrictMembers;
307
    }
308
309
    /**
310
     * @param bool $canRestrictMembers
311
     */
312
    public function setCanRestrictMembers($canRestrictMembers)
313
    {
314
        $this->canRestrictMembers = $canRestrictMembers;
315
    }
316
317
    /**
318
     * @return bool
319
     */
320
    public function getCanPinMessages()
321
    {
322
        return $this->canPinMessages;
323
    }
324
325
    /**
326
     * @param bool $canPinMessages
327
     */
328
    public function setCanPinMessages($canPinMessages)
329
    {
330
        $this->canPinMessages = $canPinMessages;
331
    }
332
333
    /**
334
     * @return bool
335
     */
336
    public function getCanPromoteMembers()
337
    {
338
        return $this->canPromoteMembers;
339
    }
340
341
    /**
342
     * @param bool $canPromoteMembers
343
     */
344
    public function setCanPromoteMembers($canPromoteMembers)
345
    {
346
        $this->canPromoteMembers = $canPromoteMembers;
347
    }
348
349
    /**
350
     * @return bool
351
     */
352
    public function getCanSendMessages()
353
    {
354
        return $this->canSendMessages;
355
    }
356
357
    /**
358
     * @param bool $canSendMessages
359
     */
360
    public function setCanSendMessages($canSendMessages)
361
    {
362
        $this->canSendMessages = $canSendMessages;
363
    }
364
365
    /**
366
     * @return bool
367
     */
368
    public function getCanSendMediaMessages()
369
    {
370
        return $this->canSendMediaMessages;
371
    }
372
373
    /**
374
     * @param bool $canSendMediaMessages
375
     */
376
    public function setCanSendMediaMessages($canSendMediaMessages)
377
    {
378
        $this->canSendMediaMessages = $canSendMediaMessages;
379
    }
380
381
    /**
382
     * @return bool
383
     */
384
    public function getCanSendOtherMessages()
385
    {
386
        return $this->canSendOtherMessages;
387
    }
388
389
    /**
390
     * @param bool $canSendOtherMessages
391
     */
392
    public function setCanSendOtherMessages($canSendOtherMessages)
393
    {
394
        $this->canSendOtherMessages = $canSendOtherMessages;
395
    }
396
397
    /**
398
     * @return bool
399
     */
400
    public function getCanAddWebPagePreviews()
401
    {
402
        return $this->canAddWebPagePreviews;
403
    }
404
405
    /**
406
     * @param bool $canAddWebPagePreviews
407
     */
408
    public function setCanAddWebPagePreviews($canAddWebPagePreviews)
409
    {
410
        $this->canAddWebPagePreviews = $canAddWebPagePreviews;
411
    }
412
}