Code Duplication    Length = 5-5 lines in 2 locations

src/Telegram.php 2 locations

@@ 842-846 (lines=5) @@
839
840
        $result = Client::setWebhook($parameters);
841
842
        if (! $result->isOk()) {
843
            throw new TelegramException(
844
                'Webhook was not set! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
845
            );
846
        }
847
848
        return $result;
849
    }
@@ 861-865 (lines=5) @@
858
    {
859
        $result = Client::deleteWebhook();
860
861
        if (! $result->isOk()) {
862
            throw new TelegramException(
863
                'Webhook was not deleted! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
864
            );
865
        }
866
867
        return $result;
868
    }