Completed
Push — master ( 479a33...82b45c )
by Leo
01:42
created

WebSocketEvents   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A message() 0 3 1
A close() 0 3 1
A error() 0 3 1
1
<?php
2
3
namespace leocata\m1Bot\Events;
4
5
use leocata\m1Bot\Interfaces\EventInterface;
6
7
class WebSocketEvents implements EventInterface
8
{
9
10
    public function message($message)
11
    {
12
        return new MessageEvent($message);
13
    }
14
15
    public function close($code, $reason)
16
    {
17
        echo "Connection closed. ({$code}){$reason}" . PHP_EOL;
18
    }
19
20
    public function error(\Exception $exception)
21
    {
22
        echo $exception->getMessage();
23
    }
24
}
25