Code Duplication    Length = 5-5 lines in 2 locations

src/Telegram.php 2 locations

@@ 711-715 (lines=5) @@
708
709
        $result = Request::setWebhook($url, $path_certificate);
710
711
        if (!$result->isOk()) {
712
            throw new TelegramException(
713
                'Webhook was not set! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
714
            );
715
        }
716
717
        return $result;
718
    }
@@ 730-734 (lines=5) @@
727
    {
728
        $result = Request::setWebhook();
729
730
        if (!$result->isOk()) {
731
            throw new TelegramException(
732
                'Webhook was not unset! Error: ' . $result->getErrorCode() . ' ' . $result->getDescription()
733
            );
734
        }
735
736
        return $result;
737
    }