Completed
Push — master ( 7dbba3...776646 )
by dan
02:24
created

User::getPusherChannelSuffix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test\Entity;
4
5
use IrishDan\NotificationBundle\EmailableInterface;
6
use IrishDan\NotificationBundle\Notification\NotifiableInterface;
7
use IrishDan\NotificationBundle\PusherableInterface;
8
use IrishDan\NotificationBundle\SlackableInterface;
9
use IrishDan\NotificationBundle\TextableInterface;
10
11
class User implements NotifiableInterface, EmailableInterface, TextableInterface, PusherableInterface, SlackableInterface
12
{
13
    public function getNumber()
14
    {
15
        return '+44755667788';
16
    }
17
18
    private $id = 1;
19
    private $username = 'jimBob';
20
    private $email = '[email protected]';
21
22
    public function getId()
23
    {
24
        return $this->id;
25
    }
26
27
    public function getUsername()
28
    {
29
        return $this->username;
30
    }
31
32
    public function setUsername($username)
33
    {
34
        $this->username = $username;
35
    }
36
37
    public function getEmail()
38
    {
39
        return $this->email;
40
    }
41
42
    public function setEmail($email)
43
    {
44
        $this->email = $email;
45
    }
46
47
    // Notifiable methods
48
    public function notifications()
49
    {
50
        // TODO: Implement notifications() method.
51
    }
52
53
    public function readNotifications()
54
    {
55
        // TODO: Implement readNotifications() method.
56
    }
57
58
    public function unreadNotifications()
59
    {
60
        // TODO: Implement unreadNotifications() method.
61
    }
62
63
    public function notify($instance)
0 ignored issues
show
Unused Code introduced by
The parameter $instance is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
64
    {
65
        // TODO: Implement notify() method.
66
    }
67
68
    public function getNotifiableDetailsForChannel($driver)
0 ignored issues
show
Unused Code introduced by
The parameter $driver is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
69
    {
70
        // TODO: Implement getNotifiableDetailsForChannel() method.
71
    }
72
73
    public function isSubscribedToChannel($channel)
74
    {
75
        $subscribedChannels = $this->getSubscribedChannels();
76
77
        return in_array($channel, $subscribedChannels);
78
    }
79
80
    public function getSubscribedChannels()
81
    {
82
        return [
83
            'database',
84
            'mail',
85
            'pusher',
86
            'nexmo',
87
            'slack',
88
        ];
89
    }
90
91
    public function getPusherChannelSuffix()
92
    {
93
        return $this->id;
94
    }
95
96
    public function getSlackWebhook()
97
    {
98
        return 'https://hooks.slack.com/services/salty/salt/1234567890';
99
    }
100
}
101