Code Duplication    Length = 23-25 lines in 3 locations

src/BotApi.php 3 locations

@@ 364-388 (lines=25) @@
361
     * @throws HttpException
362
     * @throws InvalidJsonException
363
     */
364
    public function copyMessage(
365
        $chatId,
366
        $fromChatId,
367
        $messageId,
368
        $caption = null,
369
        $parseMode = null,
370
        $captionEntities = null,
371
        $disableNotification = false,
372
        $replyToMessageId = null,
373
        $allowSendingWithoutReply = false,
374
        $replyMarkup = null
375
    ) {
376
        return Message::fromResponse($this->call('copyMessage', [
377
            'chat_id' => $chatId,
378
            'from_chat_id' => $fromChatId,
379
            'message_id' => (int)$messageId,
380
            'caption' => $caption,
381
            'parse_mode' => $parseMode,
382
            'caption_entities' => $captionEntities,
383
            'disable_notification' => (bool)$disableNotification,
384
            'reply_to_message_id' => (int)$replyToMessageId,
385
            'allow_sending_without_reply' => (bool)$allowSendingWithoutReply,
386
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
387
        ]));
388
    }
389
390
    /**
391
     * Use this method to send phone contacts
@@ 742-764 (lines=23) @@
739
     * @throws \TelegramBot\Api\InvalidArgumentException
740
     * @throws \TelegramBot\Api\Exception
741
     */
742
    public function sendVideo(
743
        $chatId,
744
        $video,
745
        $duration = null,
746
        $caption = null,
747
        $replyToMessageId = null,
748
        $replyMarkup = null,
749
        $disableNotification = false,
750
        $supportsStreaming = false,
751
        $parseMode = null
752
    ) {
753
        return Message::fromResponse($this->call('sendVideo', [
754
            'chat_id' => $chatId,
755
            'video' => $video,
756
            'duration' => $duration,
757
            'caption' => $caption,
758
            'reply_to_message_id' => $replyToMessageId,
759
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
760
            'disable_notification' => (bool)$disableNotification,
761
            'supports_streaming' => (bool)$supportsStreaming,
762
            'parse_mode' => $parseMode
763
        ]));
764
    }
765
766
    /**
767
     * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound),
@@ 901-923 (lines=23) @@
898
     * @throws \TelegramBot\Api\InvalidArgumentException
899
     * @throws \TelegramBot\Api\Exception
900
     */
901
    public function sendAudio(
902
        $chatId,
903
        $audio,
904
        $duration = null,
905
        $performer = null,
906
        $title = null,
907
        $replyToMessageId = null,
908
        $replyMarkup = null,
909
        $disableNotification = false,
910
        $parseMode = null
911
    ) {
912
        return Message::fromResponse($this->call('sendAudio', [
913
            'chat_id' => $chatId,
914
            'audio' => $audio,
915
            'duration' => $duration,
916
            'performer' => $performer,
917
            'title' => $title,
918
            'reply_to_message_id' => $replyToMessageId,
919
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
920
            'disable_notification' => (bool)$disableNotification,
921
            'parse_mode' => $parseMode
922
        ]));
923
    }
924
925
    /**
926
     * Use this method to send photos. On success, the sent Message is returned.