Completed
Push — master ( b6f353...76f563 )
by dan
02:02
created

User::setEmail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test\Entity;
4
5
use IrishDan\NotificationBundle\DatabaseNotifiableInterface;
6
use IrishDan\NotificationBundle\EmailableInterface;
7
use IrishDan\NotificationBundle\Notification\NotifiableInterface;
8
use IrishDan\NotificationBundle\PusherableInterface;
9
use IrishDan\NotificationBundle\SlackableInterface;
10
use IrishDan\NotificationBundle\TextableInterface;
11
12
class User implements NotifiableInterface, EmailableInterface, TextableInterface, PusherableInterface, SlackableInterface, DatabaseNotifiableInterface
13
{
14
    private $id = 1;
15
    private $username = 'jimBob';
16
    private $email = '[email protected]';
17
18
    public function getNumber()
19
    {
20
        return '+44755667788';
21
    }
22
23
    public function getId()
24
    {
25
        return $this->id;
26
    }
27
28
    public function getUsername()
29
    {
30
        return $this->username;
31
    }
32
33
    public function setUsername($username)
34
    {
35
        $this->username = $username;
36
    }
37
38
    public function getEmail()
39
    {
40
        return $this->email;
41
    }
42
43
    public function setEmail($email)
44
    {
45
        $this->email = $email;
46
    }
47
48
    public function isSubscribedToChannel($channel)
49
    {
50
        $subscribedChannels = $this->getSubscribedChannels();
51
52
        return in_array($channel, $subscribedChannels);
53
    }
54
55
    public function getSubscribedChannels()
56
    {
57
        return [
58
            'database',
59
            'mail',
60
            'pusher',
61
            'nexmo',
62
            'slack',
63
        ];
64
    }
65
66
    public function getPusherChannelSuffix()
67
    {
68
        return $this->id;
69
    }
70
71
    public function getSlackWebhook()
72
    {
73
        return 'https://hooks.slack.com/services/salty/salt/1234567890';
74
    }
75
76
    public function getIdentifier()
77
    {
78
        return $this->getId();
79
    }
80
}
81