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

Channel   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

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