Completed
Push — master ( 7cd9c2...0e7751 )
by dan
02:16
created

Broadcast   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 37
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setSlackWebhook() 0 4 1
A getSlackWebhook() 0 4 1
A setPusherChannel() 0 4 1
A getPusherChannel() 0 4 1
A getSubscribedChannels() 0 4 1
A isSubscribedToChannel() 0 4 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Broadcast;
4
5
use IrishDan\NotificationBundle\Notification\NotifiableInterface;
6
use IrishDan\NotificationBundle\SlackableInterface;
7
8
class Broadcast implements BroadcastNotifiableInterface, NotifiableInterface, SlackableInterface
9
{
10
    protected $slackWebhook;
11
    protected $subscribedChannels = [
12
        'slack',
13
    ];
14
15
    public function setSlackWebhook($webhook)
16
    {
17
        $this->slackWebhook = $webhook;
18
    }
19
20
    public function getSlackWebhook()
21
    {
22
        return $this->slackWebhook;
23
    }
24
25
    public function setPusherChannel($channelName)
26
    {
27
        // TODO: Implement setPusherChannel() method.
28
    }
29
30
    public function getPusherChannel()
31
    {
32
        // TODO: Implement getPusherChannel() method.
33
    }
34
35
    public function getSubscribedChannels()
36
    {
37
        $this->subscribedChannels;
38
    }
39
40
    public function isSubscribedToChannel($channel)
41
    {
42
        return in_array($this->subscribedChannels, $channel);
43
    }
44
}