EditMessageText::getMessageId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This phpFile is auto-generated.
5
 */
6
7
declare(strict_types=1);
8
9
namespace PHPTdGram\Schema;
10
11
/**
12
 * Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side.
13
 */
14
class EditMessageText extends TdFunction
15
{
16
    public const TYPE_NAME = 'editMessageText';
17
18
    /**
19
     * The chat the message belongs to.
20
     */
21
    protected int $chatId;
22
23
    /**
24
     * Identifier of the message.
25
     */
26
    protected int $messageId;
27
28
    /**
29
     * The new message reply markup; for bots only.
30
     */
31
    protected ReplyMarkup $replyMarkup;
32
33
    /**
34
     * New text content of the message. Should be of type InputMessageText.
35
     */
36
    protected InputMessageContent $inputMessageContent;
37
38
    public function __construct(int $chatId, int $messageId, ReplyMarkup $replyMarkup, InputMessageContent $inputMessageContent)
39
    {
40
        $this->chatId              = $chatId;
41
        $this->messageId           = $messageId;
42
        $this->replyMarkup         = $replyMarkup;
43
        $this->inputMessageContent = $inputMessageContent;
44
    }
45
46
    public static function fromArray(array $array): EditMessageText
47
    {
48
        return new static(
49
            $array['chat_id'],
50
            $array['message_id'],
51
            TdSchemaRegistry::fromArray($array['reply_markup']),
52
            TdSchemaRegistry::fromArray($array['input_message_content']),
53
        );
54
    }
55
56
    public function typeSerialize(): array
57
    {
58
        return [
59
            '@type'                 => static::TYPE_NAME,
60
            'chat_id'               => $this->chatId,
61
            'message_id'            => $this->messageId,
62
            'reply_markup'          => $this->replyMarkup->typeSerialize(),
63
            'input_message_content' => $this->inputMessageContent->typeSerialize(),
64
        ];
65
    }
66
67
    public function getChatId(): int
68
    {
69
        return $this->chatId;
70
    }
71
72
    public function getMessageId(): int
73
    {
74
        return $this->messageId;
75
    }
76
77
    public function getReplyMarkup(): ReplyMarkup
78
    {
79
        return $this->replyMarkup;
80
    }
81
82
    public function getInputMessageContent(): InputMessageContent
83
    {
84
        return $this->inputMessageContent;
85
    }
86
}
87