Completed
Push — master ( caff19...219001 )
by Julien
08:25
created

PublishEvent::getEligible()   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 Eole\Sandstone\Websocket\Event;
4
5
use Ratchet\Wamp\Topic;
6
use Ratchet\ConnectionInterface;
7
8
class PublishEvent extends WampEvent
9
{
10
    /**
11
     * @var string
12
     */
13
    private $event;
14
15
    /**
16
     * @var array
17
     */
18
    private $exclude;
19
20
    /**
21
     * @var array
22
     */
23
    private $eligible;
24
25
    /**
26
     * @param ConnectionInterface $conn
27
     * @param string|Topic        $topic The topic the user has attempted to publish to
28
     * @param string              $event Payload of the publish
29
     * @param array               $exclude A list of session IDs the message should be excluded from (blacklist)
30
     * @param array               $eligible A list of session Ids the message should be send to (whitelist)
31
     */
32
    public function __construct(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible)
33
    {
34
        parent::__construct($conn, $topic);
35
36
        $this->event = $event;
37
        $this->exclude = $exclude;
38
        $this->eligible = $eligible;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getEvent()
45
    {
46
        return $this->event;
47
    }
48
49
    /**
50
     * @return array
51
     */
52
    public function getExclude()
53
    {
54
        return $this->exclude;
55
    }
56
57
    /**
58
     * @return array
59
     */
60
    public function getEligible()
61
    {
62
        return $this->eligible;
63
    }
64
}
65