Completed
Branch master (7f0c44)
by Artem
02:24
created

Channel   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 36
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getListeners() 0 3 1
A __construct() 0 6 1
A getHookUrl() 0 3 1
A getPublisherToken() 0 3 1
A getSubscriberToken() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Gockets\Model;
4
5
/**
6
 * Channel object
7
 *
8
 * @package Gockets\Model
9
 * @author Artem Zakharchenko <[email protected]>
10
 */
11
final class Channel
12
{
13
    private $publisherToken;
14
15
    private $subscriberToken;
16
17
    private $hookUrl;
18
19
    private $listeners;
20
21 6
    public function __construct(string $publisherToken, string $subscriberToken, ?string $hookUrl = null, int $listeners = 0)
22
    {
23 6
        $this->publisherToken = $publisherToken;
24 6
        $this->subscriberToken = $subscriberToken;
25 6
        $this->hookUrl = $hookUrl;
26 6
        $this->listeners = $listeners;
27 6
    }
28
29 8
    public function getPublisherToken(): string
30
    {
31 8
        return $this->publisherToken;
32
    }
33
34 4
    public function getSubscriberToken(): string
35
    {
36 4
        return $this->subscriberToken;
37
    }
38
39 4
    public function getHookUrl(): ?string
40
    {
41 4
        return $this->hookUrl;
42
    }
43
44 4
    public function getListeners(): int
45
    {
46 4
        return $this->listeners;
47
    }
48
}
49