SetWebhook   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace CSlant\LaravelTelegramGitNotifier\Commands;
4
5
use CSlant\LaravelTelegramGitNotifier\Services\WebhookService;
6
use CSlant\TelegramGitNotifier\Exceptions\WebhookException;
7
use Illuminate\Console\Command;
8
9
class SetWebhook extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'tg-notifier:webhook:set';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Set webhook';
24
25
    /**
26
     * Execute the console command.
27
     *
28
     * @return void
29
     */
30
    public function handle(): void
31
    {
32
        try {
33
            $webhookService = new WebhookService();
34
35
            $this->info($webhookService->setWebhook());
36
        } catch (WebhookException $e) {
37
            $this->error($e->getMessage());
38
        }
39
    }
40
}
41