Passed
Pull Request — master (#252)
by
unknown
02:36
created

Message   F

Complexity

Total Complexity 88

Size/Duplication

Total Lines 1058
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 2

Test Coverage

Coverage 67.12%

Importance

Changes 0
Metric Value
wmc 88
lcom 3
cbo 2
dl 0
loc 1058
ccs 147
cts 219
cp 0.6712
rs 1.368
c 0
b 0
f 0

84 Methods

Rating   Name   Duplication   Size   Complexity  
A getCaption() 0 4 1
A setCaption() 0 4 1
A getAudio() 0 4 1
A setAudio() 0 4 1
A getChat() 0 4 1
A setChat() 0 4 1
A getContact() 0 4 1
A setContact() 0 4 1
A getDate() 0 4 1
A setDate() 0 8 2
A isDeleteChatPhoto() 0 4 1
A setDeleteChatPhoto() 0 4 1
A getDocument() 0 4 1
A setDocument() 0 4 1
A getForwardDate() 0 4 1
A setForwardDate() 0 8 2
A getForwardFrom() 0 4 1
A setForwardFrom() 0 4 1
A getForwardFromChat() 0 4 1
A setForwardFromChat() 0 4 1
A getForwardFromMessageId() 0 4 1
A setForwardFromMessageId() 0 4 1
A isGroupChatCreated() 0 4 1
A setGroupChatCreated() 0 4 1
A getLeftChatMember() 0 4 1
A setLeftChatMember() 0 4 1
A getLocation() 0 4 1
A setLocation() 0 4 1
A getVenue() 0 4 1
A setVenue() 0 4 1
A getPoll() 0 4 1
A setPoll() 0 4 1
A getDice() 0 4 1
A setDice() 0 4 1
A getMessageId() 0 4 1
A setMessageId() 0 8 3
A getNewChatMember() 0 4 1
A setNewChatMember() 0 4 1
A getNewChatPhoto() 0 4 1
A setNewChatPhoto() 0 4 1
A getNewChatTitle() 0 4 1
A setNewChatTitle() 0 4 1
A getPhoto() 0 4 1
A setPhoto() 0 4 1
A getMediaGroupId() 0 4 1
A setMediaGroupId() 0 4 1
A getReplyToMessage() 0 4 1
A setReplyToMessage() 0 4 1
A getSticker() 0 4 1
A setSticker() 0 4 1
A getText() 0 4 1
A setText() 0 4 1
A getEntities() 0 4 1
A setEntities() 0 4 1
A getFrom() 0 4 1
A setFrom() 0 4 1
A getVideo() 0 4 1
A setVideo() 0 4 1
A getAnimation() 0 4 1
A setAnimation() 0 4 1
A getVoice() 0 4 1
A setVoice() 0 4 1
A setSupergroupChatCreated() 0 4 1
A isSupergroupChatCreated() 0 4 1
A setChannelChatCreated() 0 4 1
A isChannelChatCreated() 0 4 1
A setMigrateToChatId() 0 4 1
A getMigrateToChatId() 0 4 1
A setMigrateFromChatId() 0 4 1
A getMigrateFromChatId() 0 4 1
A getPinnedMessage() 0 4 1
A setPinnedMessage() 0 4 1
A getInvoice() 0 4 1
A setInvoice() 0 4 1
A getSuccessfulPayment() 0 4 1
A setSuccessfulPayment() 0 4 1
A getForwardSignature() 0 4 1
A setForwardSignature() 0 4 1
A getAuthorSignature() 0 4 1
A setAuthorSignature() 0 4 1
A getCaptionEntities() 0 4 1
A setCaptionEntities() 0 4 1
A getConnectedWebsite() 0 4 1
A setConnectedWebsite() 0 4 1

How to fix   Complexity   

Complex Class

Complex classes like Message often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Message, and based on these observations, apply Extract Interface, too.

1
<?php
2
namespace TelegramBot\Api\Types;
3
4
use TelegramBot\Api\BaseType;
5
use TelegramBot\Api\InvalidArgumentException;
6
use TelegramBot\Api\TypeInterface;
7
use TelegramBot\Api\Types\Payments\Invoice;
8
use TelegramBot\Api\Types\Payments\SuccessfulPayment;
9
10
class Message extends BaseType implements TypeInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     *
15
     * @var array
16
     */
17
    static protected $requiredParams = ['message_id', 'date', 'chat'];
18
19
    /**
20
     * {@inheritdoc}
21
     *
22
     * @var array
23
     */
24
    static protected $map = [
25
        'message_id' => true,
26
        'from' => User::class,
27
        'date' => true,
28
        'chat' => Chat::class,
29
        'forward_from' => User::class,
30
        'forward_from_chat' => Chat::class,
31
        'forward_from_message_id' => true,
32
        'forward_date' => true,
33
        'reply_to_message' => Message::class,
34
        'text' => true,
35
        'entities' => ArrayOfMessageEntity::class,
36
        'caption_entities' => ArrayOfMessageEntity::class,
37
        'audio' => Audio::class,
38
        'document' => Document::class,
39
        'photo' => ArrayOfPhotoSize::class,
40
        'media_group_id' => true,
41
        'sticker' => Sticker::class,
42
        'video' => Video::class,
43
        'animation' => Animation::class,
44
        'voice' => Voice::class,
45
        'caption' => true,
46
        'contact' => Contact::class,
47
        'location' => Location::class,
48
        'venue' => Venue::class,
49
        'poll' => Poll::class,
50
        'dice' => Dice::class,
51
        'new_chat_member' => User::class,
52
        'left_chat_member' => User::class,
53
        'new_chat_title' => true,
54
        'new_chat_photo' => ArrayOfPhotoSize::class,
55
        'delete_chat_photo' => true,
56
        'group_chat_created' => true,
57
        'supergroup_chat_created' => true,
58
        'channel_chat_created' => true,
59
        'migrate_to_chat_id' => true,
60
        'migrate_from_chat_id' => true,
61
        'pinned_message' => Message::class,
62
        'invoice' => Invoice::class,
63
        'successful_payment' => SuccessfulPayment::class,
64
        'forward_signature' => true,
65
        'author_signature' => true,
66
        'connected_website' => true
67
    ];
68
69
    /**
70
     * Unique message identifier
71
     *
72
     * @var int
73
     */
74
    protected $messageId;
75
76
    /**
77
     * Optional. Sender name. Can be empty for messages sent to channels
78
     *
79
     * @var \TelegramBot\Api\Types\User
80
     */
81
    protected $from;
82
83
    /**
84
     * Date the message was sent in Unix time
85
     *
86
     * @var int
87
     */
88
    protected $date;
89
90
    /**
91
     * Conversation the message belongs to — user in case of a private message, GroupChat in case of a group
92
     *
93
     * @var \TelegramBot\Api\Types\Chat
94
     */
95
    protected $chat;
96
97
    /**
98
     * Optional. For forwarded messages, sender of the original message
99
     *
100
     * @var \TelegramBot\Api\Types\User
101
     */
102
    protected $forwardFrom;
103
104
    /**
105
     * Optional. For messages forwarded from channels, information about
106
     * the original channel
107
     *
108
     * @var \TelegramBot\Api\Types\Chat
109
     */
110
    protected $forwardFromChat;
111
112
    /**
113
     * Optional. For messages forwarded from channels, identifier of
114
     * the original message in the channel
115
     *
116
     * @var int
117
     */
118
    protected $forwardFromMessageId;
119
120
    /**
121
     * Optional. For forwarded messages, date the original message was sent in Unix time
122
     *
123
     * @var int
124
     */
125
    protected $forwardDate;
126
127
    /**
128
     * Optional. For replies, the original message. Note that the Message object in this field will not contain further
129
     * reply_to_message fields even if it itself is a reply.
130
     *
131
     * @var \TelegramBot\Api\Types\Message
132
     */
133
    protected $replyToMessage;
134
135
    /**
136
     * Optional. For text messages, the actual UTF-8 text of the message
137
     *
138
     * @var string
139
     */
140
    protected $text;
141
142
    /**
143
     * Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
144
     * array of \TelegramBot\Api\Types\MessageEntity
145
     *
146
     * @var array
147
     */
148
    protected $entities;
149
150
    /**
151
     * Optional. Message is an audio file, information about the file
152
     *
153
     * @var \TelegramBot\Api\Types\Audio
154
     */
155
    protected $audio;
156
157
    /**
158
     * Optional. Message is a general file, information about the file
159
     *
160
     * @var \TelegramBot\Api\Types\Document
161
     */
162
    protected $document;
163
164
    /**
165
     * Optional. Message is a photo, available sizes of the photo
166
     * array of \TelegramBot\Api\Types\Photo
167
     *
168
     * @var array
169
     */
170
    protected $photo;
171
172
    /**
173
     * Optional. The unique identifier of a media message group
174
     * this message belongs to
175
     *
176
     * @var int
177
     */
178
    protected $mediaGroupId;
179
180
    /**
181
     * Optional. Message is a sticker, information about the sticker
182
     *
183
     * @var \TelegramBot\Api\Types\Sticker
184
     */
185
    protected $sticker;
186
187
    /**
188
     * Optional. Message is a video, information about the video
189
     *
190
     * @var \TelegramBot\Api\Types\Video
191
     */
192
    protected $video;
193
    
194
    /**
195
     * Optional. Message is a animation, information about the animation
196
     *
197
     * @var \TelegramBot\Api\Types\Animation
198
     */
199
    protected $animation;
200
201
    /**
202
     * Optional. Message is a voice message, information about the file
203
     *
204
     * @var \TelegramBot\Api\Types\Voice
205
     */
206
    protected $voice;
207
208
    /**
209
     * Optional. Message is a shared contact, information about the contact
210
     *
211
     * @var \TelegramBot\Api\Types\Contact
212
     */
213
    protected $contact;
214
215
    /**
216
     * Optional. Message is a shared location, information about the location
217
     *
218
     * @var \TelegramBot\Api\Types\Location
219
     */
220
    protected $location;
221
222
    /**
223
     * Optional. Message is a venue, information about the venue
224
     *
225
     * @var \TelegramBot\Api\Types\Venue
226
     */
227
    protected $venue;
228
229
    /**
230
     * Optional. Message is a native poll, information about the poll
231
     *
232
     * @var \TelegramBot\Api\Types\Poll
233
     */
234
    protected $poll;
235
236
    /**
237
     * Optional. Message is a dice with random value from 1 to 6
238
     *
239
     * @var \TelegramBot\Api\Types\Dice
240
     */
241
    protected $dice;
242
243
    /**
244
     * Optional. A new member was added to the group, information about them (this member may be bot itself)
245
     *
246
     * @var \TelegramBot\Api\Types\User
247
     */
248
    protected $newChatMember;
249
250
    /**
251
     * Optional. A member was removed from the group, information about them (this member may be bot itself)
252
     *
253
     * @var \TelegramBot\Api\Types\User
254
     */
255
    protected $leftChatMember;
256
257
    /**
258
     * Optional. A group title was changed to this value
259
     *
260
     * @var string
261
     */
262
    protected $newChatTitle;
263
264
    /**
265
     * Optional. A group photo was change to this value
266
     *
267
     * @var mixed
268
     */
269
    protected $newChatPhoto;
270
271
    /**
272
     * Optional. Informs that the group photo was deleted
273
     *
274
     * @var bool
275
     */
276
    protected $deleteChatPhoto;
277
278
    /**
279
     * Optional. Informs that the group has been created
280
     *
281
     * @var bool
282
     */
283
    protected $groupChatCreated;
284
285
    /**
286
     * Optional. Text description of the video (usually empty)
287
     *
288
     * @var string
289
     */
290
    protected $caption;
291
292
293
    /**
294
     * Optional. Service message: the supergroup has been created
295
     *
296
     * @var bool
297
     */
298
    protected $supergroupChatCreated;
299
300
    /**
301
     * Optional. Service message: the channel has been created
302
     *
303
     * @var bool
304
     */
305
    protected $channelChatCreated;
306
307
    /**
308
     * Optional. The group has been migrated to a supergroup with the specified identifier,
309
     * not exceeding 1e13 by absolute value
310
     *
311
     * @var int
312
     */
313
    protected $migrateToChatId;
314
315
    /**
316
     * Optional. The supergroup has been migrated from a group with the specified identifier,
317
     * not exceeding 1e13 by absolute value
318
     *
319
     * @var int
320
     */
321
    protected $migrateFromChatId;
322
323
    /**
324
     * Optional. Specified message was pinned.Note that the Message object in this field
325
     * will not contain further reply_to_message fields even if it is itself a reply.
326
     *
327
     * @var Message
328
     */
329
    protected $pinnedMessage;
330
331
    /**
332
     * Optional. Message is an invoice for a payment, information about the invoice.
333
     *
334
     * @var Invoice
335
     */
336
    protected $invoice;
337
338
    /**
339
     * Optional. Message is a service message about a successful payment, information about the payment.
340
     *
341
     * @var SuccessfulPayment
342
     */
343
    protected $successfulPayment;
344
345
    /**
346
     * Optional. For messages forwarded from channels, signature of the post author if present
347
     *
348
     * @var string
349
     */
350
    protected $forwardSignature;
351
352
    /**
353
     * Optional. Signature of the post author for messages in channels
354
     *
355
     * @var string
356
     */
357
    protected $authorSignature;
358
359
    /**
360
     * Optional. For messages with a caption, special entities like usernames,
361
     * URLs, bot commands, etc. that appear in the caption
362
     *
363
     * @var ArrayOfMessageEntity
364
     */
365
    protected $captionEntities;
366
367
    /**
368
     * Optional. The domain name of the website on which the user has logged in.
369
     *
370
     * @var string
371
     */
372
    protected $connectedWebsite;
373
374
    /**
375
     * @return string
376
     */
377 1
    public function getCaption()
378
    {
379 1
        return $this->caption;
380
    }
381
382
    /**
383
     * @param string $caption
384
     */
385 2
    public function setCaption($caption)
386
    {
387 2
        $this->caption = $caption;
388 2
    }
389
390
    /**
391
     * @return Audio
392
     */
393 1
    public function getAudio()
394
    {
395 1
        return $this->audio;
396
    }
397
398
    /**
399
     * @param Audio $audio
400
     */
401 2
    public function setAudio(Audio $audio)
402
    {
403 2
        $this->audio = $audio;
404 2
    }
405
406
    /**
407
     * @return Chat
408
     */
409 2
    public function getChat()
410
    {
411 2
        return $this->chat;
412
    }
413
414
    /**
415
     * @param Chat $chat
416
     */
417 15
    public function setChat(Chat $chat)
418
    {
419 15
        $this->chat = $chat;
420 15
    }
421
422
    /**
423
     * @return Contact
424
     */
425 1
    public function getContact()
426
    {
427 1
        return $this->contact;
428
    }
429
430
    /**
431
     * @param Contact $contact
432
     */
433 2
    public function setContact(Contact $contact)
434
    {
435 2
        $this->contact = $contact;
436 2
    }
437
438
    /**
439
     * @return int
440
     */
441 1
    public function getDate()
442
    {
443 1
        return $this->date;
444
    }
445
446
    /**
447
     * @param int $date
448
     *
449
     * @throws InvalidArgumentException
450
     */
451 14
    public function setDate($date)
452
    {
453 14
        if (is_integer($date)) {
454 13
            $this->date = $date;
455 13
        } else {
456 1
            throw new InvalidArgumentException();
457
        }
458 13
    }
459
460
    /**
461
     * @return boolean
462
     */
463 1
    public function isDeleteChatPhoto()
464
    {
465 1
        return $this->deleteChatPhoto;
466
    }
467
468
    /**
469
     * @param boolean $deleteChatPhoto
470
     */
471 2
    public function setDeleteChatPhoto($deleteChatPhoto)
472
    {
473 2
        $this->deleteChatPhoto = (bool)$deleteChatPhoto;
474 2
    }
475
476
    /**
477
     * @return Document
478
     */
479 1
    public function getDocument()
480
    {
481 1
        return $this->document;
482
    }
483
484
    /**
485
     * @param Document $document
486
     */
487 2
    public function setDocument($document)
488
    {
489 2
        $this->document = $document;
490 2
    }
491
492
    /**
493
     * @return int
494
     */
495 1
    public function getForwardDate()
496
    {
497 1
        return $this->forwardDate;
498
    }
499
500
    /**
501
     * @param int $forwardDate
502
     *
503
     * @throws InvalidArgumentException
504
     */
505 3
    public function setForwardDate($forwardDate)
506
    {
507 3
        if (is_integer($forwardDate)) {
508 2
            $this->forwardDate = $forwardDate;
509 2
        } else {
510 1
            throw new InvalidArgumentException();
511
        }
512 2
    }
513
514
    /**
515
     * @return User
516
     */
517 1
    public function getForwardFrom()
518
    {
519 1
        return $this->forwardFrom;
520
    }
521
522
    /**
523
     * @param User $forwardFrom
524
     */
525 2
    public function setForwardFrom(User $forwardFrom)
526
    {
527 2
        $this->forwardFrom = $forwardFrom;
528 2
    }
529
530
    /**
531
     * @return Chat
532
     */
533
    public function getForwardFromChat()
534
    {
535
        return $this->forwardFromChat;
536
    }
537
538
    /**
539
     * @param Chat $forwardFromChat
540
     */
541
    public function setForwardFromChat(Chat $forwardFromChat)
542
    {
543
        $this->forwardFromChat = $forwardFromChat;
544
    }
545
546
    /**
547
     * @return int
548
     */
549
    public function getForwardFromMessageId()
550
    {
551
        return $this->forwardFromMessageId;
552
    }
553
554
    /**
555
     * @param int $forwardFromMessageId
556
     */
557
    public function setForwardFromMessageId($forwardFromMessageId)
558
    {
559
        $this->forwardFromMessageId = $forwardFromMessageId;
560
    }
561
562
    /**
563
     * @return boolean
564
     */
565 1
    public function isGroupChatCreated()
566
    {
567 1
        return $this->groupChatCreated;
568
    }
569
570
    /**
571
     * @param boolean $groupChatCreated
572
     */
573 2
    public function setGroupChatCreated($groupChatCreated)
574
    {
575 2
        $this->groupChatCreated = (bool)$groupChatCreated;
576 2
    }
577
578
    /**
579
     * @return User
580
     */
581 1
    public function getLeftChatMember()
582
    {
583 1
        return $this->leftChatMember;
584
    }
585
586
    /**
587
     * @param User $leftChatMember
588
     */
589 2
    public function setLeftChatMember($leftChatMember)
590
    {
591 2
        $this->leftChatMember = $leftChatMember;
592 2
    }
593
594
    /**
595
     * @return Location
596
     */
597 1
    public function getLocation()
598
    {
599 1
        return $this->location;
600
    }
601
602
    /**
603
     * @param Location $location
604
     */
605 2
    public function setLocation(Location $location)
606
    {
607 2
        $this->location = $location;
608 2
    }
609
610
    /**
611
     * @return Venue
612
     */
613
    public function getVenue()
614
    {
615
        return $this->venue;
616
    }
617
618
    /**
619
     * @param Venue $venue
620
     */
621
    public function setVenue($venue)
622
    {
623
        $this->venue = $venue;
624
    }
625
626
    /**
627
     * @return Poll
628
     */
629
    public function getPoll()
630
    {
631
        return $this->poll;
632
    }
633
634
    /**
635
     * @param Poll $poll
636
     */
637
    public function setPoll($poll)
638
    {
639
        $this->poll = $poll;
640
    }
641
642
    /**
643
     * @return Dice
644
     */
645
    public function getDice()
646
    {
647
        return $this->dice;
648
    }
649
650
    /**
651
     * @param Dice $dice
652
     */
653
    public function setDice($dice)
654
    {
655
        $this->dice = $dice;
656
    }
657
658
    /**
659
     * @return int
660
     */
661 1
    public function getMessageId()
662
    {
663 1
        return $this->messageId;
664
    }
665
666
    /**
667
     * @param int $messageId
668
     *
669
     * @throws InvalidArgumentException
670
     */
671 15
    public function setMessageId($messageId)
672
    {
673 15
        if (is_integer($messageId) || is_float($messageId)) {
674 14
            $this->messageId = $messageId;
0 ignored issues
show
Documentation Bug introduced by
It seems like $messageId can also be of type double. However, the property $messageId is declared as type integer. 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...
675 14
        } else {
676 1
            throw new InvalidArgumentException();
677
        }
678 14
    }
679
680
    /**
681
     * @return User
682
     */
683 1
    public function getNewChatMember()
684
    {
685 1
        return $this->newChatMember;
686
    }
687
688
    /**
689
     * @param User $newChatMember
690
     */
691 2
    public function setNewChatMember($newChatMember)
692
    {
693 2
        $this->newChatMember = $newChatMember;
694 2
    }
695
696
    /**
697
     * @return array
698
     */
699 1
    public function getNewChatPhoto()
700
    {
701 1
        return $this->newChatPhoto;
702
    }
703
704
    /**
705
     * @param array $newChatPhoto
706
     */
707 2
    public function setNewChatPhoto($newChatPhoto)
708
    {
709 2
        $this->newChatPhoto = $newChatPhoto;
710 2
    }
711
712
    /**
713
     * @return string
714
     */
715 1
    public function getNewChatTitle()
716
    {
717 1
        return $this->newChatTitle;
718
    }
719
720
    /**
721
     * @param string $newChatTitle
722
     */
723 2
    public function setNewChatTitle($newChatTitle)
724
    {
725 2
        $this->newChatTitle = $newChatTitle;
726 2
    }
727
728
    /**
729
     * @return array
730
     */
731 1
    public function getPhoto()
732
    {
733 1
        return $this->photo;
734
    }
735
736
    /**
737
     * @param array $photo
738
     */
739 2
    public function setPhoto(array $photo)
740
    {
741 2
        $this->photo = $photo;
742 2
    }
743
744
    /**
745
     * @return int
746
     */
747
    public function getMediaGroupId()
748
    {
749
        return $this->mediaGroupId;
750
    }
751
752
    /**
753
     * @param int $mediaGroupId
754
     */
755
    public function setMediaGroupId($mediaGroupId)
756
    {
757
        $this->mediaGroupId = $mediaGroupId;
758
    }
759
760
    /**
761
     * @return Message
762
     */
763 1
    public function getReplyToMessage()
764
    {
765 1
        return $this->replyToMessage;
766
    }
767
768
    /**
769
     * @param Message $replyToMessage
770
     */
771 2
    public function setReplyToMessage(Message $replyToMessage)
772
    {
773 2
        $this->replyToMessage = $replyToMessage;
774 2
    }
775
776
    /**
777
     * @return Sticker
778
     */
779 1
    public function getSticker()
780
    {
781 1
        return $this->sticker;
782
    }
783
784
    /**
785
     * @param Sticker $sticker
786
     */
787 2
    public function setSticker(Sticker $sticker)
788
    {
789 2
        $this->sticker = $sticker;
790 2
    }
791
792
    /**
793
     * @return string
794
     */
795 7
    public function getText()
796
    {
797 7
        return $this->text;
798
    }
799
800
    /**
801
     * @param string $text
802
     */
803 5
    public function setText($text)
804
    {
805 5
        $this->text = $text;
806 5
    }
807
808
    /**
809
     * @return array
810
     */
811
    public function getEntities()
812
    {
813
        return $this->entities;
814
    }
815
816
    /**
817
     * @param array $entities
818
     */
819 1
    public function setEntities($entities)
820
    {
821 1
        $this->entities = $entities;
822 1
    }
823
824
    /**
825
     * @return User
826
     */
827 1
    public function getFrom()
828
    {
829 1
        return $this->from;
830
    }
831
832
    /**
833
     * @param User $from
834
     */
835 13
    public function setFrom(User $from)
836
    {
837 13
        $this->from = $from;
838 13
    }
839
840
    /**
841
     * @return Video
842
     */
843 1
    public function getVideo()
844
    {
845 1
        return $this->video;
846
    }
847
848
    /**
849
     * @param Video $video
850
     */
851 2
    public function setVideo(Video $video)
852
    {
853 2
        $this->video = $video;
854 2
    }
855
    
856
    /**
857
     * @return Animation
858
     */
859
    public function getAnimation()
860
    {
861
        return $this->animation;
862
    }
863
864
    /**
865
     * @param Animation $animation
866
     */
867
    public function setAnimation(Animation $animation)
868
    {
869
        $this->animation = $animation;
870
    }
871
872
    /**
873
     * @return Voice
874
     */
875 1
    public function getVoice()
876
    {
877 1
        return $this->voice;
878
    }
879
880
    /**
881
     * @param Voice $voice
882
     */
883 2
    public function setVoice($voice)
884
    {
885 2
        $this->voice = $voice;
886 2
    }
887
888
    /**
889
     * @param boolean $supergroupChatCreated
890
     */
891 2
    public function setSupergroupChatCreated($supergroupChatCreated)
892
    {
893 2
        $this->supergroupChatCreated = $supergroupChatCreated;
894 2
    }
895
896
    /**
897
     * @return boolean
898
     */
899 1
    public function isSupergroupChatCreated()
900
    {
901 1
        return $this->supergroupChatCreated;
902
    }
903
904
    /**
905
     * @param boolean $channelChatCreated
906
     */
907 2
    public function setChannelChatCreated($channelChatCreated)
908
    {
909 2
        $this->channelChatCreated = $channelChatCreated;
910 2
    }
911
912
    /**
913
     * @return boolean
914
     */
915 1
    public function isChannelChatCreated()
916
    {
917 1
        return $this->channelChatCreated;
918
    }
919
920
    /**
921
     * @param int $migrateToChatId
922
     */
923 2
    public function setMigrateToChatId($migrateToChatId)
924
    {
925 2
        $this->migrateToChatId = $migrateToChatId;
926 2
    }
927
928
    /**
929
     * @return int
930
     */
931 1
    public function getMigrateToChatId()
932
    {
933 1
        return $this->migrateToChatId;
934
    }
935
936
    /**
937
     * @param int $migrateFromChatId
938
     */
939 4
    public function setMigrateFromChatId($migrateFromChatId)
940
    {
941 4
        $this->migrateFromChatId = $migrateFromChatId;
942 4
    }
943
944
    /**
945
     * @return int
946
     */
947 1
    public function getMigrateFromChatId()
948
    {
949 1
        return $this->migrateFromChatId;
950
    }
951
952
    /**
953
     * @return Message
954
     */
955
    public function getPinnedMessage()
956
    {
957
        return $this->pinnedMessage;
958
    }
959
960
    /**
961
     * @param Message $pinnedMessage
962
     */
963
    public function setPinnedMessage($pinnedMessage)
964
    {
965
        $this->pinnedMessage = $pinnedMessage;
966
    }
967
968
    /**
969
     * @author MY
970
     * @return Invoice
971
     */
972
    public function getInvoice()
973
    {
974
        return $this->invoice;
975
    }
976
977
    /**
978
     * @author MY
979
     * @param Invoice $invoice
980
     */
981
    public function setInvoice($invoice)
982
    {
983
        $this->invoice = $invoice;
984
    }
985
986
    /**
987
     * @author MY
988
     * @return SuccessfulPayment
989
     */
990
    public function getSuccessfulPayment()
991
    {
992
        return $this->successfulPayment;
993
    }
994
995
    /**
996
     * @author MY
997
     * @param SuccessfulPayment $successfulPayment
998
     */
999
    public function setSuccessfulPayment($successfulPayment)
1000
    {
1001
        $this->successfulPayment = $successfulPayment;
1002
    }
1003
1004
    /**
1005
     * @return string
1006
     */
1007
    public function getForwardSignature()
1008
    {
1009
        return $this->forwardSignature;
1010
    }
1011
1012
    /**
1013
     * @param string $forwardSignature
1014
     */
1015
    public function setForwardSignature($forwardSignature)
1016
    {
1017
        $this->forwardSignature = $forwardSignature;
1018
    }
1019
1020
    /**
1021
     * @return string
1022
     */
1023
    public function getAuthorSignature()
1024
    {
1025
        return $this->authorSignature;
1026
    }
1027
1028
    /**
1029
     * @param string $authorSignature
1030
     */
1031
    public function setAuthorSignature($authorSignature)
1032
    {
1033
        $this->authorSignature = $authorSignature;
1034
    }
1035
1036
    /**
1037
     * @return ArrayOfMessageEntity
1038
     */
1039
    public function getCaptionEntities()
1040
    {
1041
        return $this->captionEntities;
1042
    }
1043
1044
    /**
1045
     * @param ArrayOfMessageEntity $captionEntities
1046
     */
1047
    public function setCaptionEntities($captionEntities)
1048
    {
1049
        $this->captionEntities = $captionEntities;
1050
    }
1051
1052
    /**
1053
     * @return string
1054
     */
1055
    public function getConnectedWebsite()
1056
    {
1057
        return $this->connectedWebsite;
1058
    }
1059
1060
    /**
1061
     * @param string $connectedWebsite
1062
     */
1063
    public function setConnectedWebsite($connectedWebsite)
1064
    {
1065
        $this->connectedWebsite = $connectedWebsite;
1066
    }
1067
}
1068