Completed
Push — master ( 2e004f...db8ff8 )
by dan
01:41
created

Broadcast   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 44
rs 10

7 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
A getPusherChannelSuffix() 0 4 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Broadcast;
4
5
use IrishDan\NotificationBundle\Notification\NotifiableInterface;
6
use IrishDan\NotificationBundle\PusherableInterface;
7
use IrishDan\NotificationBundle\SlackableInterface;
8
9
class Broadcast implements BroadcastNotifiableInterface, NotifiableInterface, SlackableInterface, PusherableInterface
10
{
11
    protected $slackWebhook;
12
    protected $pusherChannel;
13
    protected $subscribedChannels = [
14
        'slack',
15
        'pusher',
16
    ];
17
18
    public function setSlackWebhook($webhook)
19
    {
20
        $this->slackWebhook = $webhook;
21
    }
22
23
    public function getSlackWebhook()
24
    {
25
        return $this->slackWebhook;
26
    }
27
28
    public function setPusherChannel($pusherChannel)
29
    {
30
        $this->pusherChannel = $pusherChannel;
31
    }
32
33
    public function getPusherChannel()
34
    {
35
        return $this->pusherChannel;
36
    }
37
38
    public function getSubscribedChannels()
39
    {
40
        $this->subscribedChannels;
41
    }
42
43
    public function isSubscribedToChannel($channel)
44
    {
45
        return in_array($this->subscribedChannels, $channel);
46
    }
47
48
    public function getPusherChannelSuffix()
49
    {
50
        return 'broadcast';
51
    }
52
}