Completed
Push — master ( cbd26f...25ba26 )
by dan
02:08
created

TestNotification::getTemplateArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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
        // @TODO: Not really representative of the real template directory structure.
68
        // return 'NotificationBundle:Test:' . $this->channel . '.message.html.twig';
0 ignored issues
show
Unused Code Comprehensibility introduced by
40% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
69
        return [
70
            'title' => 'title.message.html.twig',
71
            'body' => $this->channel . '.message.html.twig',
72
        ];
73
    }
74
}