MessageActionHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the slince/spike package.
5
 *
6
 * (c) Slince <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Spike\Server\Handler;
13
14
use React\Socket\ConnectionInterface;
15
use Slince\EventDispatcher\Dispatcher;
16
use Spike\Server\Server;
17
18
abstract class MessageActionHandler implements ActionHandlerInterface
19
{
20
    /**
21
     * @var Server
22
     */
23
    protected $server;
24
25
    /**
26
     * @var ConnectionInterface
27
     */
28
    protected $connection;
29
30
    public function __construct(Server $server, ConnectionInterface $connection)
31
    {
32
        $this->server = $server;
33
        $this->connection = $connection;
34
    }
35
36
    /**
37
     * Gets the event dispatcher.
38
     *
39
     * @return Dispatcher
40
     */
41
    public function getEventDispatcher()
42
    {
43
        return $this->server->getEventDispatcher();
44
    }
45
}