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 animation files (GIF or H.264/MPEG-4 AVC video without sound),
@@ 825-847 (lines=23) @@
822
     * @throws \TelegramBot\Api\InvalidArgumentException
823
     * @throws \TelegramBot\Api\Exception
824
     */
825
    public function sendAudio(
826
        $chatId,
827
        $audio,
828
        $duration = null,
829
        $performer = null,
830
        $title = null,
831
        $replyToMessageId = null,
832
        $replyMarkup = null,
833
        $disableNotification = false,
834
        $parseMode = null
835
    ) {
836
        return Message::fromResponse($this->call('sendAudio', [
837
            'chat_id' => $chatId,
838
            'audio' => $audio,
839
            'duration' => $duration,
840
            'performer' => $performer,
841
            'title' => $title,
842
            'reply_to_message_id' => $replyToMessageId,
843
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
844
            'disable_notification' => (bool)$disableNotification,
845
            'parse_mode' => $parseMode
846
        ]));
847
    }
848
849
    /**
850
     * Use this method to send photos. On success, the sent Message is returned.