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,
@@ 784-806 (lines=23) @@
781
     * @throws \TelegramBot\Api\InvalidArgumentException
782
     * @throws \TelegramBot\Api\Exception
783
     */
784
    public function sendAudio(
785
        $chatId,
786
        $audio,
787
        $duration = null,
788
        $performer = null,
789
        $title = null,
790
        $replyToMessageId = null,
791
        $replyMarkup = null,
792
        $disableNotification = false,
793
        $parseMode = null
794
    ) {
795
        return Message::fromResponse($this->call('sendAudio', [
796
            'chat_id' => $chatId,
797
            'audio' => $audio,
798
            'duration' => $duration,
799
            'performer' => $performer,
800
            'title' => $title,
801
            'reply_to_message_id' => $replyToMessageId,
802
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
803
            'disable_notification' => (bool)$disableNotification,
804
            'parse_mode' => $parseMode
805
        ]));
806
    }
807
808
    /**
809
     * Use this method to send photos. On success, the sent Message is returned.