| Total Complexity | 6 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class SetPollAnswer extends TdFunction |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'setPollAnswer'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Identifier of the chat to which the poll belongs. |
||
| 20 | * |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | protected int $chatId; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Identifier of the message containing the poll. |
||
| 27 | * |
||
| 28 | * @var int |
||
| 29 | */ |
||
| 30 | protected int $messageId; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers. |
||
| 34 | * |
||
| 35 | * @var int[] |
||
| 36 | */ |
||
| 37 | protected array $optionIds; |
||
| 38 | |||
| 39 | public function __construct(int $chatId, int $messageId, array $optionIds) |
||
| 40 | { |
||
| 41 | $this->chatId = $chatId; |
||
| 42 | $this->messageId = $messageId; |
||
| 43 | $this->optionIds = $optionIds; |
||
| 44 | } |
||
| 45 | |||
| 46 | public static function fromArray(array $array): SetPollAnswer |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | public function typeSerialize(): array |
||
| 56 | { |
||
| 57 | return [ |
||
| 58 | '@type' => static::TYPE_NAME, |
||
| 59 | 'chat_id' => $this->chatId, |
||
| 60 | 'message_id' => $this->messageId, |
||
| 61 | 'option_ids' => $this->optionIds, |
||
| 62 | ]; |
||
| 63 | } |
||
| 64 | |||
| 65 | public function getChatId(): int |
||
| 66 | { |
||
| 67 | return $this->chatId; |
||
| 68 | } |
||
| 69 | |||
| 70 | public function getMessageId(): int |
||
| 73 | } |
||
| 74 | |||
| 75 | public function getOptionIds(): array |
||
| 78 | } |
||
| 79 | } |
||
| 80 |