Code Duplication    Length = 23-23 lines in 2 locations

src/BotApi.php 2 locations

@@ 667-689 (lines=23) @@
664
     * @throws \TelegramBot\Api\InvalidArgumentException
665
     * @throws \TelegramBot\Api\Exception
666
     */
667
    public function sendVideo(
668
        $chatId,
669
        $video,
670
        $duration = null,
671
        $caption = null,
672
        $replyToMessageId = null,
673
        $replyMarkup = null,
674
        $disableNotification = false,
675
        $supportsStreaming = false,
676
        $parseMode = null
677
    ) {
678
        return Message::fromResponse($this->call('sendVideo', [
679
            'chat_id' => $chatId,
680
            'video' => $video,
681
            'duration' => $duration,
682
            'caption' => $caption,
683
            'reply_to_message_id' => $replyToMessageId,
684
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
685
            'disable_notification' => (bool)$disableNotification,
686
            'supports_streaming' => (bool)$supportsStreaming,
687
            'parse_mode' => $parseMode
688
        ]));
689
    }
690
691
    /**
692
     * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound),
@@ 826-848 (lines=23) @@
823
     * @throws \TelegramBot\Api\InvalidArgumentException
824
     * @throws \TelegramBot\Api\Exception
825
     */
826
    public function sendAudio(
827
        $chatId,
828
        $audio,
829
        $duration = null,
830
        $performer = null,
831
        $title = null,
832
        $replyToMessageId = null,
833
        $replyMarkup = null,
834
        $disableNotification = false,
835
        $parseMode = null
836
    ) {
837
        return Message::fromResponse($this->call('sendAudio', [
838
            'chat_id' => $chatId,
839
            'audio' => $audio,
840
            'duration' => $duration,
841
            'performer' => $performer,
842
            'title' => $title,
843
            'reply_to_message_id' => $replyToMessageId,
844
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
845
            'disable_notification' => (bool)$disableNotification,
846
            'parse_mode' => $parseMode
847
        ]));
848
    }
849
850
    /**
851
     * Use this method to send photos. On success, the sent Message is returned.