Completed
Pull Request — master (#110)
by Charlotte
06:09
created

SimpleMessageHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onConnection() 0 4 1
A onError() 0 4 1
1
<?php
2
/**
3
 * This file is a part of Woketo package.
4
 *
5
 * (c) Nekland <[email protected]>
6
 *
7
 * For the full license, take a look to the LICENSE file
8
 * on the root directory of this project
9
 */
10
11
namespace Nekland\Woketo\Message;
12
13
14
use Nekland\Woketo\Exception\WebsocketException;
15
use Nekland\Woketo\Server\Connection;
16
17
abstract class SimpleMessageHandler implements MessageHandlerInterface
18
{
19
    public function onConnection(Connection $connection)
20
    {
21
        // Doing nothing
22
    }
23
24
    public function onError(WebsocketException $e, Connection $connection)
25
    {
26
        echo 'An error occurred : ' . $e->getMessage();
27
    }
28
}
29