@@ -52,17 +52,17 @@ discard block |
||
| 52 | 52 | $this->buffer = ''; |
| 53 | 53 | $this->handler = $handler; |
| 54 | 54 | |
| 55 | - $clientPromise->then(function (ConnectionInterface $stream) {
|
|
| 55 | + $clientPromise->then(function(ConnectionInterface $stream) {
|
|
| 56 | 56 | $this->stream = $stream; |
| 57 | 57 | $this->onConnection($stream); |
| 58 | - }, function (\Exception $error) {
|
|
| 58 | + }, function(\Exception $error) {
|
|
| 59 | 59 | $this->onError($error); |
| 60 | 60 | }); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | private function onConnection(ConnectionInterface $stream) |
| 64 | 64 | {
|
| 65 | - $stream->on('data', function (string $data) {
|
|
| 65 | + $stream->on('data', function(string $data) {
|
|
| 66 | 66 | $this->onMessage($data); |
| 67 | 67 | }); |
| 68 | 68 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | if ($this->currentMessage->isComplete()) {
|
| 125 | 125 | // Sending the message through the woketo API. |
| 126 | - switch($this->currentMessage->getOpcode()) {
|
|
| 126 | + switch ($this->currentMessage->getOpcode()) {
|
|
| 127 | 127 | case Frame::OP_TEXT: |
| 128 | 128 | $this->getHandler()->onMessage($this->currentMessage->getContent(), $this); |
| 129 | 129 | break; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | } else {
|
| 137 | 137 | // We wait for more data so we start a timeout. |
| 138 | - $this->timeout = $this->loop->addTimer(Connection::DEFAULT_TIMEOUT, function () {
|
|
| 138 | + $this->timeout = $this->loop->addTimer(Connection::DEFAULT_TIMEOUT, function() {
|
|
| 139 | 139 | $this->getLogger()->notice('Connection to ' . $this->getIp() . ' timed out.');
|
| 140 | 140 | $this->messageProcessor->timeout($this->stream); |
| 141 | 141 | }); |