Completed
Pull Request — master (#144)
by
unknown
01:58
created
src/Core/AbstractConnection.php 1 patch
Unused Use Statements   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@
 block discarded – undo
11 11
 
12 12
 namespace Nekland\Woketo\Core;
13 13
 
14
-use Nekland\Woketo\Exception\NoHandlerException;
15
-use Nekland\Woketo\Exception\WebsocketException;
16
-use Nekland\Woketo\Message\MessageHandlerInterface;
17
-use Nekland\Woketo\Rfc6455\Frame;
18
-use Nekland\Woketo\Rfc6455\Handshake\HandshakeInterface;
19
-use Nekland\Woketo\Rfc6455\Message;
20
-use Nekland\Woketo\Rfc6455\MessageProcessor;
21
-use Nekland\Woketo\Utils\SimpleLogger;
22
-use Psr\Log\LoggerAwareTrait;
23
-use Psr\Log\LoggerInterface;
24
-use React\EventLoop\LoopInterface;
25
-use React\EventLoop\TimerInterface;
26
-use React\Socket\Connection;
14
+use Nekland\Woketo\Exception\NoHandlerException;
15
+use Nekland\Woketo\Exception\WebsocketException;
16
+use Nekland\Woketo\Message\MessageHandlerInterface;
17
+use Nekland\Woketo\Rfc6455\Frame;
18
+use Nekland\Woketo\Rfc6455\Handshake\HandshakeInterface;
19
+use Nekland\Woketo\Rfc6455\Message;
20
+use Nekland\Woketo\Rfc6455\MessageProcessor;
21
+use Nekland\Woketo\Utils\SimpleLogger;
22
+use Psr\Log\LoggerAwareTrait;
23
+use Psr\Log\LoggerInterface;
24
+use React\EventLoop\LoopInterface;
25
+use React\EventLoop\TimerInterface;
26
+use React\Socket\Connection;
27 27
 use React\Socket\ConnectionInterface;
28 28
 
29 29
 abstract class AbstractConnection
Please login to merge, or discard this patch.
src/Rfc6455/Message.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
     /**
56 56
      * Add some data to the buffer.
57 57
      *
58
-     * @param $data
58
+     * @param string $data
59 59
      */
60 60
     public function addBuffer($data)
61 61
     {
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
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 
41 41
     private function initListeners()
42 42
     {
43
-        $this->stream->on('data', function ($data) {
43
+        $this->stream->on('data', function($data) {
44 44
             $this->processData($data);
45 45
         });
46 46
         $this->stream->once('end', function() {
47 47
             $this->getHandler()->onDisconnect($this);
48 48
         });
49
-        $this->stream->on('error', function ($data) {
49
+        $this->stream->on('error', function($data) {
50 50
             $this->error($data);
51 51
         });
52 52
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $this->currentMessage = $message;
89 89
             if ($this->currentMessage->isComplete()) {
90 90
                 // Sending the message through the woketo API.
91
-                switch($this->currentMessage->getOpcode()) {
91
+                switch ($this->currentMessage->getOpcode()) {
92 92
                     case Frame::OP_TEXT:
93 93
                         $this->getHandler()->onMessage($this->currentMessage->getContent(), $this);
94 94
                         break;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
             } else {
102 102
                 // We wait for more data so we start a timeout.
103
-                $this->timeout = $this->loop->addTimer(Connection::DEFAULT_TIMEOUT, function () {
103
+                $this->timeout = $this->loop->addTimer(Connection::DEFAULT_TIMEOUT, function() {
104 104
                     $this->logger->notice('Connection to ' . $this->getIp() . ' timed out.');
105 105
                     $this->messageProcessor->timeout($this->stream);
106 106
                 });
Please login to merge, or discard this patch.