Completed
Push — master ( ebdf7a...2dba39 )
by Vladimir
05:12
created

Channel::getWebhookUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot;
6
7
class Channel
8
{
9
    private $name;
10
    private $driver;
11
    private $secret;
12
13
    public function __construct(string $name, Driver $driver, string $secret = null)
14
    {
15
        $this->name = $name;
16
        $this->driver = $driver;
17
        $this->secret = $secret;
18
    }
19
20
    public function getName(): string
21
    {
22
        return $this->name;
23
    }
24
25
    public function getDriver(): Driver
26
    {
27
        return $this->driver;
28
    }
29
30
    public function getSecret(): ?string
31
    {
32
        return $this->secret;
33
    }
34
35
    public function getWebhookUrl(): string
36
    {
37
        return route('fondbot.webhook', [$this->name, $this->secret]);
38
    }
39
}
40