Code Duplication    Length = 15-17 lines in 3 locations

src/BotApi.php 3 locations

@@ 706-720 (lines=15) @@
703
     * @throws \TelegramBot\Api\InvalidArgumentException
704
     * @throws \TelegramBot\Api\Exception
705
     */
706
    public function sendSticker(
707
        $chatId,
708
        $sticker,
709
        $replyToMessageId = null,
710
        $replyMarkup = null,
711
        $disableNotification = false
712
    ) {
713
        return Message::fromResponse($this->call('sendSticker', [
714
            'chat_id' => $chatId,
715
            'sticker' => $sticker,
716
            'reply_to_message_id' => $replyToMessageId,
717
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
718
            'disable_notification' => (bool)$disableNotification,
719
        ]));
720
    }
721
722
    /**
723
     * Use this method to send video files,
@@ 1231-1247 (lines=17) @@
1228
     * @throws \TelegramBot\Api\InvalidArgumentException
1229
     * @throws \TelegramBot\Api\Exception
1230
     */
1231
    public function editMessageCaption(
1232
        $chatId,
1233
        $messageId,
1234
        $caption = null,
1235
        $replyMarkup = null,
1236
        $inlineMessageId = null,
1237
        $parseMode = null
1238
    ) {
1239
        return Message::fromResponse($this->call('editMessageCaption', [
1240
            'chat_id' => $chatId,
1241
            'message_id' => $messageId,
1242
            'inline_message_id' => $inlineMessageId,
1243
            'caption' => $caption,
1244
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
1245
            'parse_mode' => $parseMode
1246
        ]));
1247
    }
1248
1249
    /**
1250
     * Use this method to edit animation, audio, document, photo, or video messages.
@@ 1267-1281 (lines=15) @@
1264
     * @throws HttpException
1265
     * @throws InvalidJsonException
1266
     */
1267
    public function editMessageMedia(
1268
        $chatId,
1269
        $messageId,
1270
        InputMedia $media,
1271
        $inlineMessageId = null,
1272
        $replyMarkup = null
1273
    ) {
1274
        return Message::fromResponse($this->call('editMessageMedia', [
1275
            'chat_id' => $chatId,
1276
            'message_id' => $messageId,
1277
            'inline_message_id' => $inlineMessageId,
1278
            'media' => $media->toJson(),
1279
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
1280
        ]));
1281
    }
1282
1283
    /**
1284
     * Use this method to edit only the reply markup of messages sent by the bot or via the bot