• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vjik / telegram-bot-api / 18555831557

16 Oct 2025 08:54AM UTC coverage: 99.481% (-0.5%) from 100.0%
18555831557

Pull #167

github

web-flow
Merge ce82b2b9b into e5d621537
Pull Request #167: Add webhook response factories

0 of 35 new or added lines in 3 files covered. (0.0%)

6713 of 6748 relevant lines covered (99.48%)

28.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/WebhookResponse/JsonWebhookResponseFactory.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Vjik\TelegramBot\Api\WebhookResponse;
6

7
use Vjik\TelegramBot\Api\MethodInterface;
8

9
/**
10
 * @api
11
 */
12
final readonly class JsonWebhookResponseFactory
13
{
14
    /**
15
     * @throws MethodNotSupportedException If method doesn't support sending via a webhook response.
16
     */
NEW
17
    public function create(WebhookResponse $webhookResponse): string
×
18
    {
NEW
19
        return json_encode($webhookResponse->getData(), JSON_THROW_ON_ERROR);
×
20
    }
21

22
    /**
23
     * @throws MethodNotSupportedException If method doesn't support sending via a webhook response.
24
     */
NEW
25
    public function byMethod(MethodInterface $method): string
×
26
    {
NEW
27
        return $this->create(new WebhookResponse($method));
×
28
    }
29
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc