@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $this->buildMessageProcessor(); |
| 99 | 99 | |
| 100 | 100 | // Some optimization |
| 101 | - \gc_enable(); // As the process never stops, the garbage collector will be usefull, you may need to call it manually sometimes for performance purpose |
|
| 101 | + \gc_enable(); // As the process never stops, the garbage collector will be usefull, you may need to call it manually sometimes for performance purpose |
|
| 102 | 102 | \set_time_limit(0); // It's by default on most server for cli apps but better be sure of that fact |
| 103 | 103 | } |
| 104 | 104 | |
@@ -108,13 +108,13 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function setMessageHandler($messageHandler, $uri = '*') |
| 110 | 110 | { |
| 111 | - if (!$messageHandler instanceof MessageHandlerInterface && !\is_string($messageHandler)) { |
|
| 111 | + if (!$messageHandler instanceof MessageHandlerInterface && !\is_string($messageHandler)) { |
|
| 112 | 112 | throw new \InvalidArgumentException('The message handler must be an instance of MessageHandlerInterface or a string.'); |
| 113 | 113 | } |
| 114 | 114 | if (\is_string($messageHandler)) { |
| 115 | 115 | try { |
| 116 | 116 | $reflection = new \ReflectionClass($messageHandler); |
| 117 | - if(!$reflection->implementsInterface('Nekland\Woketo\Message\MessageHandlerInterface')) { |
|
| 117 | + if (!$reflection->implementsInterface('Nekland\Woketo\Message\MessageHandlerInterface')) { |
|
| 118 | 118 | throw new \InvalidArgumentException('The messageHandler must implement MessageHandlerInterface'); |
| 119 | 119 | } |
| 120 | 120 | } catch (\ReflectionException $e) { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $this->getLogger()->info('Enabled ssl'); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - $this->server->on('connection', function ($socketStream) { |
|
| 149 | + $this->server->on('connection', function($socketStream) { |
|
| 150 | 150 | $this->onNewConnection($socketStream); |
| 151 | 151 | }); |
| 152 | 152 | |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | private function onNewConnection(ConnectionInterface $socketStream) |
| 162 | 162 | { |
| 163 | - $connection = new Connection($socketStream, function ($uri, Connection $connection) { |
|
| 163 | + $connection = new Connection($socketStream, function($uri, Connection $connection) { |
|
| 164 | 164 | return $this->getMessageHandler($uri, $connection); |
| 165 | 165 | }, $this->loop, $this->messageProcessor); |
| 166 | 166 | |
| 167 | - $socketStream->on('end', function () use($connection) { |
|
| 167 | + $socketStream->on('end', function() use($connection) { |
|
| 168 | 168 | $this->onDisconnect($connection); |
| 169 | 169 | }); |
| 170 | 170 | |