Completed
Push — master ( 705569...50fbec )
by dan
02:16
created

User   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 90
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 15
lcom 0
cbo 0
dl 0
loc 90
rs 10
c 1
b 0
f 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getNumber() 0 4 1
A getId() 0 4 1
A getUsername() 0 4 1
A setUsername() 0 4 1
A getEmail() 0 4 1
A setEmail() 0 4 1
A notifications() 0 4 1
A readNotifications() 0 4 1
A unreadNotifications() 0 4 1
A notify() 0 4 1
A getNotifiableDetailsForChannel() 0 4 1
A isSubscribedToChannel() 0 6 1
A getSubscribedChannels() 0 10 1
A getChannelSuffix() 0 4 1
A getSlackWebhook() 0 4 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test\Entity;
4
5
use IrishDan\NotificationBundle\Emailable;
6
use IrishDan\NotificationBundle\Notification\NotifiableInterface;
7
use IrishDan\NotificationBundle\Pusherable;
8
use IrishDan\NotificationBundle\Slackable;
9
use IrishDan\NotificationBundle\Textable;
10
11
class User implements NotifiableInterface, Emailable, Textable, Pusherable, Slackable
12
{
13
    public function getNumber()
14
    {
15
        return '+44755667788';
16
    }
17
18
    private $id = 1;
19
    private $username = 'jimBob';
20
    private $email = 'jim@jim,.bob';
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)
64
    {
65
        // TODO: Implement notify() method.
66
    }
67
68
    public function getNotifiableDetailsForChannel($driver)
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 getChannelSuffix()
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