Code Duplication    Length = 23-23 lines in 2 locations

src/BotApi.php 2 locations

@@ 666-688 (lines=23) @@
663
     * @throws \TelegramBot\Api\InvalidArgumentException
664
     * @throws \TelegramBot\Api\Exception
665
     */
666
    public function sendVideo(
667
        $chatId,
668
        $video,
669
        $duration = null,
670
        $caption = null,
671
        $replyToMessageId = null,
672
        $replyMarkup = null,
673
        $disableNotification = false,
674
        $supportsStreaming = false,
675
        $parseMode = null
676
    ) {
677
        return Message::fromResponse($this->call('sendVideo', [
678
            'chat_id' => $chatId,
679
            'video' => $video,
680
            'duration' => $duration,
681
            'caption' => $caption,
682
            'reply_to_message_id' => $replyToMessageId,
683
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
684
            'disable_notification' => (bool)$disableNotification,
685
            'supports_streaming' => (bool)$supportsStreaming,
686
            'parse_mode' => $parseMode
687
        ]));
688
    }
689
690
    /**
691
     * Use this method to send audio files,
@@ 841-863 (lines=23) @@
838
     * @throws \TelegramBot\Api\InvalidArgumentException
839
     * @throws \TelegramBot\Api\Exception
840
     */
841
    public function sendAudio(
842
        $chatId,
843
        $audio,
844
        $duration = null,
845
        $performer = null,
846
        $title = null,
847
        $replyToMessageId = null,
848
        $replyMarkup = null,
849
        $disableNotification = false,
850
        $parseMode = null
851
    ) {
852
        return Message::fromResponse($this->call('sendAudio', [
853
            'chat_id' => $chatId,
854
            'audio' => $audio,
855
            'duration' => $duration,
856
            'performer' => $performer,
857
            'title' => $title,
858
            'reply_to_message_id' => $replyToMessageId,
859
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
860
            'disable_notification' => (bool)$disableNotification,
861
            'parse_mode' => $parseMode
862
        ]));
863
    }
864
865
    /**
866
     * Use this method to send photos. On success, the sent Message is returned.