Completed
Pull Request — master (#4)
by dan
14:39
created

EventChannel::dispatch()   A

Complexity

Conditions 3
Paths 6

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 9.584
c 0
b 0
f 0
cc 3
nc 6
nop 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A EventChannel::formatAndDispatch() 0 4 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Channel;
4
5
use IrishDan\NotificationBundle\Adapter\MessageAdapterInterface;
6
use IrishDan\NotificationBundle\Dispatcher\MessageDispatcherInterface;
7
use IrishDan\NotificationBundle\Event\MessageCreatedEvent;
8
use IrishDan\NotificationBundle\Event\MessageDispatchedEvent;
9
use IrishDan\NotificationBundle\Exception\MessageDispatchException;
10
use IrishDan\NotificationBundle\Message\MessageInterface;
11
use IrishDan\NotificationBundle\Notification\NotificationInterface;
12
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
13
14
/**
15
 * Class EventChannel
16
 *
17
 * This type of channel dispatched events when each Message
18
 * is created..
19
 * and when each Message is dispatched
20
 *
21
 * @package NotificationBundle\Channel
22
 */
23
class EventChannel extends BaseChannel implements ChannelInterface
24
{
25
    /**
26
     * An array of all available adapters.
27
     *
28
     * @var array
29
     */
30
    private $adapters = [];
31
    private $eventDispatcher;
32
33
    /**
34
     * @param                         $key
35
     * @param MessageAdapterInterface $adapter
36
     * @param array                   $config
37
     */
38
    public function setAdapters($key, MessageAdapterInterface $adapter, array $config)
39
    {
40
        // $adapter->setChannelName($key);
41
        $adapter->setConfiguration($config);
42
43
        $this->adapters[$key] = $adapter;
44
    }
45
46
    /**
47
     * @param NotificationInterface $notification
48
     * @return bool
49
     */
50
    public function formatAndDispatch(NotificationInterface $notification)
51
    {
52
        return false;
53
    }
54
}
55