Channel   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 69.23%

Importance

Changes 0
Metric Value
wmc 5
eloc 11
dl 0
loc 31
c 0
b 0
f 0
ccs 9
cts 13
cp 0.6923
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getSecret() 0 3 1
A getDriver() 0 3 1
A __construct() 0 5 1
A getWebhookUrl() 0 3 1
A getName() 0 3 1
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