@@ -23,7 +23,6 @@ |
||
23 | 23 | use Nekland\Woketo\Rfc6455\ServerHandshake; |
24 | 24 | use Nekland\Woketo\Utils\SimpleLogger; |
25 | 25 | use Psr\Log\LoggerInterface; |
26 | -use Psr\Log\LogLevel; |
|
27 | 26 | use React\EventLoop\LoopInterface; |
28 | 27 | use React\Socket\ConnectionInterface; |
29 | 28 |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | |
92 | 92 | private function initListeners() |
93 | 93 | { |
94 | - $this->socketStream->on('data', function ($data) { |
|
94 | + $this->socketStream->on('data', function($data) { |
|
95 | 95 | $this->processData($data); |
96 | 96 | }); |
97 | - $this->socketStream->on('error', function ($data) { |
|
97 | + $this->socketStream->on('error', function($data) { |
|
98 | 98 | $this->error($data); |
99 | 99 | }); |
100 | 100 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->currentMessage = $message; |
134 | 134 | if ($this->currentMessage->isComplete()) { |
135 | 135 | // Sending the message through the woketo API. |
136 | - switch($this->currentMessage->getOpcode()) { |
|
136 | + switch ($this->currentMessage->getOpcode()) { |
|
137 | 137 | case Frame::OP_TEXT: |
138 | 138 | $this->handler->onMessage($this->currentMessage->getContent(), $this); |
139 | 139 | break; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | } else { |
147 | 147 | // We wait for more data so we start a timeout. |
148 | - $this->timeout = $this->loop->addTimer(Connection::DEFAULT_TIMEOUT, function () { |
|
148 | + $this->timeout = $this->loop->addTimer(Connection::DEFAULT_TIMEOUT, function() { |
|
149 | 149 | $this->logger->notice('Connection to ' . $this->getIp() . ' timed out.'); |
150 | 150 | $this->messageProcessor->timeout($this->socketStream); |
151 | 151 | }); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | // Doesn't log everything in not debug context |
40 | 40 | if ($this->debug || \in_array($level, [LogLevel::CRITICAL, LogLevel::ERROR])) { |
41 | - echo '[' . date('Y-m-d H:i:s') . '][' . $level . '] ' . $message ."\n"; |
|
41 | + echo '[' . date('Y-m-d H:i:s') . '][' . $level . '] ' . $message . "\n"; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | } |