Code Duplication    Length = 5-5 lines in 2 locations

src/Telegram.php 2 locations

@@ 744-748 (lines=5) @@
741
742
        $result = Request::setWebhook($url, $path_certificate);
743
744
        if (!$result->isOk()) {
745
            throw new TelegramException(
746
                'Webhook was not set! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
747
            );
748
        }
749
750
        return $result;
751
    }
@@ 763-767 (lines=5) @@
760
    {
761
        $result = Request::setWebhook();
762
763
        if (!$result->isOk()) {
764
            throw new TelegramException(
765
                'Webhook was not unset! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
766
            );
767
        }
768
769
        return $result;
770
    }