WebhookAction::set()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 0
dl 0
loc 3
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace CSlant\LaravelTelegramGitNotifier\Http\Actions;
4
5
use CSlant\LaravelTelegramGitNotifier\Services\WebhookService;
6
use CSlant\TelegramGitNotifier\Exceptions\WebhookException;
7
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
49
    {
50
        return $this->webhookService->getUpdates();
51
    }
52
53
    /**
54
     * Get webhook info.
55
     *
56
     * @return string
57
     *
58
     * @throws WebhookException
59
     */
60
    public function getWebHookInfo(): string
61
    {
62
        return $this->webhookService->getWebHookInfo();
63
    }
64
}
65