Code Duplication    Length = 15-17 lines in 3 locations

src/BotApi.php 3 locations

@@ 631-645 (lines=15) @@
628
     * @throws \TelegramBot\Api\InvalidArgumentException
629
     * @throws \TelegramBot\Api\Exception
630
     */
631
    public function sendSticker(
632
        $chatId,
633
        $sticker,
634
        $replyToMessageId = null,
635
        $replyMarkup = null,
636
        $disableNotification = false
637
    ) {
638
        return Message::fromResponse($this->call('sendSticker', [
639
            'chat_id' => $chatId,
640
            'sticker' => $sticker,
641
            'reply_to_message_id' => $replyToMessageId,
642
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
643
            'disable_notification' => (bool)$disableNotification,
644
        ]));
645
    }
646
647
    /**
648
     * Use this method to send video files,
@@ 1074-1088 (lines=15) @@
1071
     * @throws \TelegramBot\Api\InvalidArgumentException
1072
     * @throws \TelegramBot\Api\Exception
1073
     */
1074
    public function editMessageCaption(
1075
        $chatId,
1076
        $messageId,
1077
        $caption = null,
1078
        $replyMarkup = null,
1079
        $inlineMessageId = null
1080
    ) {
1081
        return Message::fromResponse($this->call('editMessageCaption', [
1082
            'chat_id' => $chatId,
1083
            'message_id' => $messageId,
1084
            'inline_message_id' => $inlineMessageId,
1085
            'caption' => $caption,
1086
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
1087
        ]));
1088
    }
1089
1090
    /**
1091
     * Use this method to edit only the reply markup of messages sent by the bot or via the bot
@@ 1719-1735 (lines=17) @@
1716
     * @throws \TelegramBot\Api\InvalidArgumentException
1717
     * @throws \TelegramBot\Api\Exception
1718
     */
1719
    public function sendPoll(
1720
        $chatId,
1721
        $question,
1722
        $options,
1723
        $disableNotification = false,
1724
        $replyToMessageId = null,
1725
        $replyMarkup = null
1726
    ) {
1727
        return Message::fromResponse($this->call('sendPoll', [
1728
            'chat_id' => $chatId,
1729
            'question' => $question,
1730
            'options' => json_encode($options),
1731
            'disable_notification' => (bool)$disableNotification,
1732
            'reply_to_message_id' => (int)$replyToMessageId,
1733
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
1734
        ]));
1735
    }
1736
1737
    /**
1738
     * Use this method to stop a poll which was sent by the bot.