UpdateChatReplyMarkup   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A fromArray() 0 5 1
A typeSerialize() 0 6 1
A getChatId() 0 3 1
A getReplyMarkupMessageId() 0 3 1
1
<?php
2
3
/**
4
 * This phpFile is auto-generated.
5
 */
6
7
declare(strict_types=1);
8
9
namespace AurimasNiekis\TdLibSchema;
10
11
/**
12
 * The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user.
13
 */
14
class UpdateChatReplyMarkup extends Update
15
{
16
    public const TYPE_NAME = 'updateChatReplyMarkup';
17
18
    /**
19
     * Chat identifier.
20
     *
21
     * @var int
22
     */
23
    protected int $chatId;
24
25
    /**
26
     * Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat.
27
     *
28
     * @var int
29
     */
30
    protected int $replyMarkupMessageId;
31
32
    public function __construct(int $chatId, int $replyMarkupMessageId)
33
    {
34
        parent::__construct();
35
36
        $this->chatId               = $chatId;
37
        $this->replyMarkupMessageId = $replyMarkupMessageId;
38
    }
39
40
    public static function fromArray(array $array): UpdateChatReplyMarkup
41
    {
42
        return new static(
43
            $array['chat_id'],
44
            $array['reply_markup_message_id'],
45
        );
46
    }
47
48
    public function typeSerialize(): array
49
    {
50
        return [
51
            '@type'                   => static::TYPE_NAME,
52
            'chat_id'                 => $this->chatId,
53
            'reply_markup_message_id' => $this->replyMarkupMessageId,
54
        ];
55
    }
56
57
    public function getChatId(): int
58
    {
59
        return $this->chatId;
60
    }
61
62
    public function getReplyMarkupMessageId(): int
63
    {
64
        return $this->replyMarkupMessageId;
65
    }
66
}
67