Completed
Push — master ( 6ee4e9...166b13 )
by dan
02:00
created

BaseChannel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setDispatcher() 0 4 1
A setDataFormatter() 0 4 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Channel;
4
5
use IrishDan\NotificationBundle\Formatter\MessageFormatterInterface;
6
use IrishDan\NotificationBundle\Dispatcher\MessageDispatcherInterface;
7
8
abstract class BaseChannel implements ChannelInterface
9
{
10
    protected $channelEnabled;
11
    protected $channelConfiguration;
12
    protected $channel;
13
    protected $formatter;
14
    protected $dispatcher;
15
16
    public function __construct($channelEnabled = true, array $channelConfiguration = [], $channel = '')
17
    {
18
        $this->channelEnabled       = $channelEnabled;
19
        $this->channelConfiguration = $channelConfiguration;
20
        $this->channel              = $channel;
21
    }
22
23
    public function setDispatcher(MessageDispatcherInterface $dispatcher)
24
    {
25
        $this->dispatcher = $dispatcher;
26
    }
27
28
    public function setDataFormatter(MessageFormatterInterface $formatter)
29
    {
30
        $this->formatter = $formatter;
31
    }
32
}
33