TestNotification   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

10 Methods

Rating   Name   Duplication   Size   Complexity  
A setChannel() 0 4 1
A getChannel() 0 4 1
A getUuid() 0 4 1
A setUuid() 0 4 1
A getNotifiable() 0 4 1
A setNotifiable() 0 4 1
A getChannels() 0 4 1
A getDataArray() 0 4 1
A setDataArray() 0 4 1
A getTemplateArray() 0 8 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test\Notification;
4
5
use IrishDan\NotificationBundle\Notification\NotificationInterface;
6
use IrishDan\NotificationBundle\Notification\NotifiableInterface;
7
8
class TestNotification implements NotificationInterface
9
{
10
    protected $notifiable;
11
    protected $channel;
12
    protected $uuid;
13
14
    public function setChannel($channel)
15
    {
16
        $this->channel = $channel;
17
    }
18
19
    public function getChannel()
20
    {
21
        return $this->channel;
22
    }
23
24
    public function getUuid()
25
    {
26
        return $this->uuid;
27
    }
28
29
    public function setUuid($uuid)
30
    {
31
        $this->uuid = $uuid;
32
    }
33
34
    public function getNotifiable()
35
    {
36
        return $this->notifiable;
37
    }
38
39
    public function setNotifiable(NotifiableInterface $notifiable)
40
    {
41
        $this->notifiable = $notifiable;
42
    }
43
44
    public function getChannels()
45
    {
46
        return ['mail', 'database', 'pusher', 'nexmo', 'slack'];
47
    }
48
49
    protected $dataArray = [
50
        'title' => 'New member',
51
        'body' => 'A new member has just joined',
52
    ];
53
54
    public function getDataArray()
55
    {
56
        return $this->dataArray;
57
    }
58
59
    public function setDataArray(array $data)
60
    {
61
        $this->dataArray = $data;
62
    }
63
64
    public function getTemplateArray()
65
    {
66
        // The view template to use for this message. can switch depending on the channel.
67
        return [
68
            'title' => 'title.message.html.twig',
69
            'body' => $this->channel . '.message.html.twig',
70
        ];
71
    }
72
}