Channel::getWebhookUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Channels;
6
7
class Channel
8
{
9
    private $name;
10
    private $driver;
11
    private $secret;
12
13 4
    public function __construct(string $name, Driver $driver, string $secret = null)
14
    {
15 4
        $this->name = $name;
16 4
        $this->driver = $driver;
17 4
        $this->secret = $secret;
18 4
    }
19
20 3
    public function getName(): string
21
    {
22 3
        return $this->name;
23
    }
24
25 1
    public function getDriver(): Driver
26
    {
27 1
        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