Code Duplication    Length = 5-5 lines in 2 locations

src/Telegram.php 2 locations

@@ 756-760 (lines=5) @@
753
754
        $result = Request::setWebhook($url, $data);
755
756
        if (!$result->isOk()) {
757
            throw new TelegramException(
758
                'Webhook was not set! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
759
            );
760
        }
761
762
        return $result;
763
    }
@@ 788-792 (lines=5) @@
785
    {
786
        $result = Request::deleteWebhook();
787
788
        if (!$result->isOk()) {
789
            throw new TelegramException(
790
                'Webhook was not deleted! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
791
            );
792
        }
793
794
        return $result;
795
    }