Completed
Push — master ( 367b4e...a600c8 )
by Vladimir
02:25
created

Channel   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 69.23%

Importance

Changes 0
Metric Value
dl 0
loc 33
ccs 9
cts 13
cp 0.6923
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getDriver() 0 4 1
A getSecret() 0 4 1
A getWebhookUrl() 0 4 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 1
    public function __construct(string $name, Driver $driver, string $secret = null)
14
    {
15 1
        $this->name = $name;
16 1
        $this->driver = $driver;
17 1
        $this->secret = $secret;
18 1
    }
19
20 1
    public function getName(): string
21
    {
22 1
        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