Completed
Push — master ( 82da5d...012a80 )
by Charlotte
10s
created
src/Server/WebSocketServer.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Server/Connection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 });
Please login to merge, or discard this patch.
src/Utils/SimpleLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.