Completed
Push — master ( db8ff8...4137d9 )
by dan
01:59
created

DummyAdapter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 28
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A format() 0 10 1
A dispatch() 0 4 1
A getChannelName() 0 4 1
A getConfiguration() 0 4 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test\Adapter;
4
5
use IrishDan\NotificationBundle\Adapter\BaseMessageAdapter;
6
use IrishDan\NotificationBundle\Adapter\MessageAdapterInterface;
7
use IrishDan\NotificationBundle\Message\MessageInterface;
8
use IrishDan\NotificationBundle\Notification\NotificationInterface;
9
10
class DummyAdapter extends BaseMessageAdapter implements MessageAdapterInterface
11
{
12
    public function format(NotificationInterface $notification)
13
    {
14
        $notification->setChannel($this->channelName);
15
        parent::format($notification);
16
17
        $dispatchData = [];
18
        $messageData = self::createMessagaData([]);
19
20
        return self::createMessage($dispatchData, $messageData, $this->channelName);
21
    }
22
23
    public function dispatch(MessageInterface $message)
24
    {
25
        return true;
26
    }
27
28
    public function getChannelName()
29
    {
30
        return $this->channelName;
31
    }
32
33
    public function getConfiguration()
34
    {
35
        return $this->configuration;
36
    }
37
}