Code Duplication    Length = 23-23 lines in 2 locations

src/BotApi.php 2 locations

@@ 665-687 (lines=23) @@
662
     * @throws \TelegramBot\Api\InvalidArgumentException
663
     * @throws \TelegramBot\Api\Exception
664
     */
665
    public function sendVideo(
666
        $chatId,
667
        $video,
668
        $duration = null,
669
        $caption = null,
670
        $replyToMessageId = null,
671
        $replyMarkup = null,
672
        $disableNotification = false,
673
        $supportsStreaming = false,
674
        $parseMode = null
675
    ) {
676
        return Message::fromResponse($this->call('sendVideo', [
677
            'chat_id' => $chatId,
678
            'video' => $video,
679
            'duration' => $duration,
680
            'caption' => $caption,
681
            'reply_to_message_id' => $replyToMessageId,
682
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
683
            'disable_notification' => (bool)$disableNotification,
684
            'supports_streaming' => (bool)$supportsStreaming,
685
            'parse_mode' => $parseMode
686
        ]));
687
    }
688
689
    /**
690
     * Use this method to send audio files,
@@ 783-805 (lines=23) @@
780
     * @throws \TelegramBot\Api\InvalidArgumentException
781
     * @throws \TelegramBot\Api\Exception
782
     */
783
    public function sendAudio(
784
        $chatId,
785
        $audio,
786
        $duration = null,
787
        $performer = null,
788
        $title = null,
789
        $replyToMessageId = null,
790
        $replyMarkup = null,
791
        $disableNotification = false,
792
        $parseMode = null
793
    ) {
794
        return Message::fromResponse($this->call('sendAudio', [
795
            'chat_id' => $chatId,
796
            'audio' => $audio,
797
            'duration' => $duration,
798
            'performer' => $performer,
799
            'title' => $title,
800
            'reply_to_message_id' => $replyToMessageId,
801
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
802
            'disable_notification' => (bool)$disableNotification,
803
            'parse_mode' => $parseMode
804
        ]));
805
    }
806
807
    /**
808
     * Use this method to send photos. On success, the sent Message is returned.