Code Duplication    Length = 21-23 lines in 3 locations

src/BotApi.php 3 locations

@@ 682-704 (lines=23) @@
679
     * @throws \TelegramBot\Api\InvalidArgumentException
680
     * @throws \TelegramBot\Api\Exception
681
     */
682
    public function sendVideo(
683
        $chatId,
684
        $video,
685
        $duration = null,
686
        $caption = null,
687
        $replyToMessageId = null,
688
        $replyMarkup = null,
689
        $disableNotification = false,
690
        $supportsStreaming = false,
691
        $parseMode = null
692
    ) {
693
        return Message::fromResponse($this->call('sendVideo', [
694
            'chat_id' => $chatId,
695
            'video' => $video,
696
            'duration' => $duration,
697
            'caption' => $caption,
698
            'reply_to_message_id' => $replyToMessageId,
699
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
700
            'disable_notification' => (bool)$disableNotification,
701
            'supports_streaming' => (bool)$supportsStreaming,
702
            'parse_mode' => $parseMode
703
        ]));
704
    }
705
706
    /**
707
     * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound),
@@ 725-745 (lines=21) @@
722
     * @throws \TelegramBot\Api\InvalidArgumentException
723
     * @throws \TelegramBot\Api\Exception
724
     */
725
    public function sendAnimation(
726
        $chatId,
727
        $animation,
728
        $duration = null,
729
        $caption = null,
730
        $replyToMessageId = null,
731
        $replyMarkup = null,
732
        $disableNotification = false,
733
        $parseMode = null
734
    ) {
735
        return Message::fromResponse($this->call('sendAnimation', [
736
            'chat_id' => $chatId,
737
            'animation' => $animation,
738
            'duration' => $duration,
739
            'caption' => $caption,
740
            'reply_to_message_id' => $replyToMessageId,
741
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
742
            'disable_notification' => (bool)$disableNotification,
743
            'parse_mode' => $parseMode
744
        ]));
745
    }
746
747
    /**
748
     * 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.