Completed
Push — master ( 5c8063...9a2413 )
by Taosikai
13:00
created

MessageHandler::getServer()   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
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Spike library
4
 * @author Tao <[email protected]>
5
 */
6
namespace Spike\Server\Handler;
7
8
use React\Socket\ConnectionInterface;
9
use Slince\Event\Dispatcher;
10
use Spike\Server\Server;
11
12
abstract class MessageHandler implements HandlerInterface
13
{
14
    /**
15
     * @var Server
16
     */
17
    protected $server;
18
19
    /**
20
     * @var ConnectionInterface
21
     */
22
    protected $connection;
23
24
    public function __construct(Server $server, ConnectionInterface $connection)
25
    {
26
        $this->server = $server;
27
        $this->connection = $connection;
28
    }
29
30
    /**
31
     * Gets the event dispatcher
32
     * @return Dispatcher
33
     */
34
    public function getDispatcher()
35
    {
36
        return $this->server->getDispatcher();
37
    }
38
39
    /**
40
     * Gets the server instance
41
     * @return Server
42
     */
43
    public function getServer()
44
    {
45
        return $this->server;
46
    }
47
}