TestNotification::setDataArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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
}