Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
8 | class WebhookAction |
||
9 | { |
||
10 | protected WebhookService $webhookService; |
||
11 | |||
12 | public function __construct() |
||
13 | { |
||
14 | $this->webhookService = new WebhookService(); |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Set webhook for telegram bot. |
||
19 | * |
||
20 | * @return string |
||
21 | * |
||
22 | * @throws WebhookException |
||
23 | */ |
||
24 | public function set(): string |
||
25 | { |
||
26 | return $this->webhookService->setWebhook(); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Delete webhook for telegram bot. |
||
31 | * |
||
32 | * @return string |
||
33 | * |
||
34 | * @throws WebhookException |
||
35 | */ |
||
36 | public function delete(): string |
||
37 | { |
||
38 | return $this->webhookService->deleteWebHook(); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Get webhook update. |
||
43 | * |
||
44 | * @return string |
||
45 | * |
||
46 | * @throws WebhookException |
||
47 | */ |
||
48 | public function getUpdates(): string |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Get webhook info. |
||
55 | * |
||
56 | * @return string |
||
57 | * |
||
58 | * @throws WebhookException |
||
59 | */ |
||
60 | public function getWebHookInfo(): string |
||
63 | } |
||
64 | } |
||
65 |