Passed
Push — master ( 58897c...6910c8 )
by Alexander
06:09 queued 12s
created

ChatMember::getCustomTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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
        'can_manage_topics' => true,
39
        'is_anonymous' => true,
40
        'custom_title' => true,
41
        'can_manage_chat' => true,
42
        'can_send_polls' => true,
43
    ];
44
45
    /**
46
     * Information about the user
47
     *
48
     * @var User
49
     */
50
    protected $user;
51
52
    /**
53
     * The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
54
     *
55
     * @var string
56
     */
57
    protected $status;
58
59
    /**
60
     * Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
61
     *
62
     * @var integer
63
     */
64
    protected $untilDate;
65
66
    /**
67
     * Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
68
     *
69
     * @var bool
70
     */
71
    protected $canBeEdited;
72
73
    /**
74
     * Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings
75
     *
76
     * @var bool
77
     */
78
    protected $canChangeInfo;
79
80
    /**
81
     * Optional. Administrators only. True, if the administrator can post in the channel, channels only
82
     *
83
     * @var bool
84
     */
85
    protected $canPostMessages;
86
87
    /**
88
     * Optional. Administrators only. True, if the administrator can edit messages of other users, channels only
89
     *
90
     * @var bool
91
     */
92
    protected $canEditMessages;
93
94
    /**
95
     * Optional. Administrators only. True, if the administrator can delete messages of other users
96
     *
97
     * @var bool
98
     */
99
    protected $canDeleteMessages;
100
101
    /**
102
     * Optional. Administrators only. True, if the administrator can invite new users to the chat
103
     *
104
     * @var bool
105
     */
106
    protected $canInviteUsers;
107
108
    /**
109
     * Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members
110
     *
111
     * @var bool
112
     */
113
    protected $canRestrictMembers;
114
115
    /**
116
     * Optional. Administrators only. True, if the administrator can pin messages, supergroups only
117
     *
118
     * @var bool
119
     */
120
    protected $canPinMessages;
121
122
    /**
123
     * Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own
124
     * privileges or demote administrators that he has promoted, directly or indirectly
125
     * (promoted by administrators that were appointed by the user)
126
     *
127
     * @var bool
128
     */
129
    protected $canPromoteMembers;
130
131
    /**
132
     * Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues
133
     *
134
     * @var bool
135
     */
136
    protected $canSendMessages;
137
138
    /**
139
     * Optional. Restricted only. True, if the user can send audios, documents, photos, videos, video notes
140
     * and voice notes, implies can_send_messages
141
     *
142
     * @var bool
143
     */
144
    protected $canSendMediaMessages;
145
146
    /**
147
     * Optional. Restricted only. True, if the user can send animations, games, stickers and use inline bots,
148
     * implies can_send_media_messages
149
     *
150
     * @var bool
151
     */
152
    protected $canSendOtherMessages;
153
154
    /**
155
     * Optional. Restricted only. True, if user may add web page previews to his messages,
156
     * implies can_send_media_messages
157
     *
158
     * @var bool
159
     */
160
    protected $canAddWebPagePreviews;
161
162
    /**
163
     * Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
164
     *
165
     * @var bool
166
     */
167
    protected $canManageTopics;
168
169
    /**
170
     * True, if the user's presence in the chat is hidden
171
     *
172
     * @var bool
173
     */
174
    protected $isAnonymous;
175
176
    /**
177
     * Optional. Custom title for this user
178
     *
179
     * @var string
180
     */
181
    protected $customTitle;
182
183
    /**
184
     * True, if the administrator can access the chat event log, chat statistics, message statistics in channels,
185
     * see channel members, see anonymous administrators in supergroups and ignore slow mode.
186
     * Implied by any other administrator privilege
187
     *
188
     * @var bool
189
     */
190
    protected $canManageChat;
191
192
    /**
193
     * True, if the user is allowed to send polls
194
     *
195
     * @var bool
196
     */
197
    protected $canSendPolls;
198
199
    /**
200
     * @return User
201
     */
202
    public function getUser()
203
    {
204
        return $this->user;
205
    }
206
207
    /**
208
     * @param User $user
209
     */
210
    public function setUser($user)
211
    {
212
        $this->user = $user;
213
    }
214
215
    /**
216
     * @return string
217
     */
218
    public function getStatus()
219
    {
220
        return $this->status;
221
    }
222
223
    /**
224
     * @param string $status
225
     */
226
    public function setStatus($status)
227
    {
228
        $this->status = $status;
229
    }
230
231
    /**
232
     * @return int
233
     */
234
    public function getUntilDate()
235
    {
236
        return $this->untilDate;
237
    }
238
239
    /**
240
     * @param int $untilDate
241
     */
242
    public function setUntilDate($untilDate)
243
    {
244
        $this->untilDate = $untilDate;
245
    }
246
247
    /**
248
     * @return bool
249
     */
250
    public function getCanBeEdited()
251
    {
252
        return $this->canBeEdited;
253
    }
254
255
    /**
256
     * @param bool $canBeEdited
257
     */
258
    public function setCanBeEdited($canBeEdited)
259
    {
260
        $this->canBeEdited = $canBeEdited;
261
    }
262
263
    /**
264
     * @return bool
265
     */
266
    public function getCanChangeInfo()
267
    {
268
        return $this->canChangeInfo;
269
    }
270
271
    /**
272
     * @param bool $canChangeInfo
273
     */
274
    public function setCanChangeInfo($canChangeInfo)
275
    {
276
        $this->canChangeInfo = $canChangeInfo;
277
    }
278
279
    /**
280
     * @return bool
281
     */
282
    public function getCanPostMessages()
283
    {
284
        return $this->canPostMessages;
285
    }
286
287
    /**
288
     * @param bool $canPostMessages
289
     */
290
    public function setCanPostMessages($canPostMessages)
291
    {
292
        $this->canPostMessages = $canPostMessages;
293
    }
294
295
    /**
296
     * @return bool
297
     */
298
    public function getCanEditMessages()
299
    {
300
        return $this->canEditMessages;
301
    }
302
303
    /**
304
     * @param bool $canEditMessages
305
     */
306
    public function setCanEditMessages($canEditMessages)
307
    {
308
        $this->canEditMessages = $canEditMessages;
309
    }
310
311
    /**
312
     * @return bool
313
     */
314
    public function getCanDeleteMessages()
315
    {
316
        return $this->canDeleteMessages;
317
    }
318
319
    /**
320
     * @param bool $canDeleteMessages
321
     */
322
    public function setCanDeleteMessages($canDeleteMessages)
323
    {
324
        $this->canDeleteMessages = $canDeleteMessages;
325
    }
326
327
    /**
328
     * @return bool
329
     */
330
    public function getCanInviteUsers()
331
    {
332
        return $this->canInviteUsers;
333
    }
334
335
    /**
336
     * @param bool $canInviteUsers
337
     */
338
    public function setCanInviteUsers($canInviteUsers)
339
    {
340
        $this->canInviteUsers = $canInviteUsers;
341
    }
342
343
    /**
344
     * @return bool
345
     */
346
    public function getCanRestrictMembers()
347
    {
348
        return $this->canRestrictMembers;
349
    }
350
351
    /**
352
     * @param bool $canRestrictMembers
353
     */
354
    public function setCanRestrictMembers($canRestrictMembers)
355
    {
356
        $this->canRestrictMembers = $canRestrictMembers;
357
    }
358
359
    /**
360
     * @return bool
361
     */
362
    public function getCanPinMessages()
363
    {
364
        return $this->canPinMessages;
365
    }
366
367
    /**
368
     * @param bool $canPinMessages
369
     */
370
    public function setCanPinMessages($canPinMessages)
371
    {
372
        $this->canPinMessages = $canPinMessages;
373
    }
374
375
    /**
376
     * @return bool
377
     */
378
    public function getCanPromoteMembers()
379
    {
380
        return $this->canPromoteMembers;
381
    }
382
383
    /**
384
     * @param bool $canPromoteMembers
385
     */
386
    public function setCanPromoteMembers($canPromoteMembers)
387
    {
388
        $this->canPromoteMembers = $canPromoteMembers;
389
    }
390
391
    /**
392
     * @return bool
393
     */
394
    public function getCanSendMessages()
395
    {
396
        return $this->canSendMessages;
397
    }
398
399
    /**
400
     * @param bool $canSendMessages
401
     */
402
    public function setCanSendMessages($canSendMessages)
403
    {
404
        $this->canSendMessages = $canSendMessages;
405
    }
406
407
    /**
408
     * @return bool
409
     */
410
    public function getCanSendMediaMessages()
411
    {
412
        return $this->canSendMediaMessages;
413
    }
414
415
    /**
416
     * @param bool $canSendMediaMessages
417
     */
418
    public function setCanSendMediaMessages($canSendMediaMessages)
419
    {
420
        $this->canSendMediaMessages = $canSendMediaMessages;
421
    }
422
423
    /**
424
     * @return bool
425
     */
426
    public function getCanSendOtherMessages()
427
    {
428
        return $this->canSendOtherMessages;
429
    }
430
431
    /**
432
     * @param bool $canSendOtherMessages
433
     */
434
    public function setCanSendOtherMessages($canSendOtherMessages)
435
    {
436
        $this->canSendOtherMessages = $canSendOtherMessages;
437
    }
438
439
    /**
440
     * @return bool
441
     */
442
    public function getCanAddWebPagePreviews()
443
    {
444
        return $this->canAddWebPagePreviews;
445
    }
446
447
    /**
448
     * @param bool $canAddWebPagePreviews
449
     */
450
    public function setCanAddWebPagePreviews($canAddWebPagePreviews)
451
    {
452
        $this->canAddWebPagePreviews = $canAddWebPagePreviews;
453
    }
454
455
    /**
456
     * @return bool
457
     */
458
    public function getCanManageChat()
459
    {
460
        return $this->canManageChat;
461
    }
462
463
    /**
464
     * @param bool $canManageChat
465
     */
466
    public function setCanManageChat($canManageChat)
467
    {
468
        $this->canManageChat = $canManageChat;
469
    }
470
471
    /**
472
     * @return bool
473
     */
474
    public function getIsAnonymous()
475
    {
476
        return $this->isAnonymous;
477
    }
478
479
    /**
480
     * @param bool $isAnonymous
481
     */
482
    public function setIsAnonymous($isAnonymous)
483
    {
484
        $this->isAnonymous = $isAnonymous;
485
    }
486
487
    /**
488
     * @return bool
489
     */
490
    public function getCanSendPolls()
491
    {
492
        return $this->canSendPolls;
493
    }
494
495
    /**
496
     * @param bool $canSendPolls
497
     */
498
    public function setCanSendPolls($canSendPolls)
499
    {
500
        $this->canSendPolls = $canSendPolls;
501
    }
502
503
    /**
504
     * @return bool
505
     */
506
    public function getCanManageTopics()
507
    {
508
        return $this->canManageTopics;
509
    }
510
511
    /**
512
     * @param bool $canManageTopics
513
     */
514
    public function setCanManageTopics($canManageTopics)
515
    {
516
        $this->canManageTopics = $canManageTopics;
517
    }
518
519
    /**
520
     * @return string
521
     */
522
    public function getCustomTitle()
523
    {
524
        return $this->customTitle;
525
    }
526
527
    /**
528
     * @param string $customTitle
529
     */
530
    public function setCustomTitle($customTitle)
531
    {
532
        $this->customTitle = $customTitle;
533
    }
534
}
535