Code Duplication    Length = 5-5 lines in 2 locations

src/Telegram.php 2 locations

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