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

RPCEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 4
1
<?php
2
3
namespace Eole\Sandstone\Websocket\Event;
4
5
use Ratchet\Wamp\Topic;
6
use Ratchet\ConnectionInterface;
7
8
class RPCEvent extends WampEvent
9
{
10
    /**
11
     * @var string|Topic
12
     */
13
    private $id;
14
15
    /**
16
     * @var array
17
     */
18
    private $params;
19
20
    /**
21
     * @param ConnectionInterface $conn
22
     * @param string|Topic        $topic The topic to execute the call against
23
     * @param string              $id The unique ID of the RPC, required to respond to
24
     * @param array               $params Call parameters received from the client
25
     */
26
    public function __construct(ConnectionInterface $conn, $topic, $id, array $params)
27
    {
28
        parent::__construct($conn, $topic);
29
30
        $this->id = $id;
31
        $this->params = $params;
32
    }
33
34
    /**
35
     * @return string|Topic
36
     */
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function getParams()
46
    {
47
        return $this->params;
48
    }
49
}
50