Code Duplication    Length = 10-11 lines in 5 locations

src/BotApi.php 5 locations

@@ 679-688 (lines=10) @@
676
     * @throws \TelegramBot\Api\InvalidArgumentException
677
     * @throws \TelegramBot\Api\Exception
678
     */
679
    public function sendDocument(
680
        $chatId,
681
        $document,
682
        $replyToMessageId = null,
683
        $replyMarkup = null,
684
        $disableNotification = false
685
    ) {
686
        return Message::fromResponse($this->call('sendDocument', [
687
            'chat_id' => $chatId,
688
            'document' => $document,
689
            'reply_to_message_id' => $replyToMessageId,
690
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
691
            'disable_notification' => (bool) $disableNotification
@@ 439-449 (lines=11) @@
436
     * @return \TelegramBot\Api\Types\Message
437
     * @throws \TelegramBot\Api\Exception
438
     */
439
    public function sendLocation(
440
        $chatId,
441
        $latitude,
442
        $longitude,
443
        $replyToMessageId = null,
444
        $replyMarkup = null,
445
        $disableNotification = false
446
    ) {
447
        return Message::fromResponse($this->call('sendLocation', [
448
            'chat_id' => $chatId,
449
            'latitude' => $latitude,
450
            'longitude' => $longitude,
451
            'reply_to_message_id' => $replyToMessageId,
452
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
@@ 470-479 (lines=10) @@
467
     * @throws \TelegramBot\Api\InvalidArgumentException
468
     * @throws \TelegramBot\Api\Exception
469
     */
470
    public function sendSticker(
471
        $chatId,
472
        $sticker,
473
        $replyToMessageId = null,
474
        $replyMarkup = null,
475
        $disableNotification = false
476
    ) {
477
        return Message::fromResponse($this->call('sendSticker', [
478
            'chat_id' => $chatId,
479
            'sticker' => $sticker,
480
            'reply_to_message_id' => $replyToMessageId,
481
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
482
            'disable_notification' => (bool) $disableNotification
@@ 542-552 (lines=11) @@
539
     * @throws \TelegramBot\Api\InvalidArgumentException
540
     * @throws \TelegramBot\Api\Exception
541
     */
542
    public function sendVoice(
543
        $chatId,
544
        $voice,
545
        $duration = null,
546
        $replyToMessageId = null,
547
        $replyMarkup = null,
548
        $disableNotification = false
549
    ) {
550
        return Message::fromResponse($this->call('sendVoice', [
551
            'chat_id' => $chatId,
552
            'voice' => $voice,
553
            'duration' => $duration,
554
            'reply_to_message_id' => $replyToMessageId,
555
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),
@@ 647-657 (lines=11) @@
644
     * @throws \TelegramBot\Api\InvalidArgumentException
645
     * @throws \TelegramBot\Api\Exception
646
     */
647
    public function sendPhoto(
648
        $chatId,
649
        $photo,
650
        $caption = null,
651
        $replyToMessageId = null,
652
        $replyMarkup = null,
653
        $disableNotification = false
654
    ) {
655
        return Message::fromResponse($this->call('sendPhoto', [
656
            'chat_id' => $chatId,
657
            'photo' => $photo,
658
            'caption' => $caption,
659
            'reply_to_message_id' => $replyToMessageId,
660
            'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson(),