Completed
Pull Request — master (#22)
by Timo
02:31
created
src/Tidal/WampWatch/SessionMonitor.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
     public function getSessionInfo($sessionId, callable $callback = null)
104 104
     {
105 105
         return $this->session->call(self::SESSION_INFO_TOPIC, [$sessionId])->then(
106
-            function ($res) use ($callback) {
106
+            function($res) use ($callback) {
107 107
                 $this->emit('info', [$res[0]]);
108 108
                 if ($callback !== null) {
109 109
                     $callback($res[0]);
110 110
                 }
111 111
             },
112
-            function ($error) {
112
+            function($error) {
113 113
                 $this->emit('error', [$error]);
114 114
             }
115 115
         );
@@ -204,25 +204,25 @@  discard block
 block discarded – undo
204 204
     protected function startSubscriptions()
205 205
     {
206 206
         // subscription to 'wamp.session.on_join'
207
-        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function (array $res) {
207
+        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function(array $res) {
208 208
             $sessionInfo = $res[0];
209 209
             if (!$this->validateSessionInfo($sessionInfo) || $this->hasSession($sessionInfo)) {
210 210
                 return;
211 211
             }
212 212
             $this->addSession($sessionInfo);
213
-        })->then(function (SubscribedMessage $msg) {
213
+        })->then(function(SubscribedMessage $msg) {
214 214
             $this->joinSubscriptionId = $msg->getSubscriptionId();
215 215
             $this->checkStarted();
216 216
         });
217 217
 
218 218
         // subscription to 'wamp.session.on_leave'
219
-        $this->session->subscribe(self::SESSION_LEAVE_TOPIC, function (array $res) {
219
+        $this->session->subscribe(self::SESSION_LEAVE_TOPIC, function(array $res) {
220 220
             // @bug : wamp.session.on_leave is bugged as of crossbar.io 0.11.0
221 221
             // will provide sessionID when Browser closes/reloads,
222 222
             // but not when calling connection.close();
223 223
             $sessionId = (int) $res[0];
224 224
             $this->removeSessionId($sessionId);
225
-        })->then(function (SubscribedMessage $msg) {
225
+        })->then(function(SubscribedMessage $msg) {
226 226
             $this->leaveSubscriptionId = $msg->getSubscriptionId();
227 227
             $this->checkStarted();
228 228
         });
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     protected function retrieveSessionIds(callable $callback = null)
250 250
     {
251 251
         $this->session->call(self::SESSION_LIST_TOPIC, [])->then(
252
-            function ($res) use ($callback) {
252
+            function($res) use ($callback) {
253 253
                 // remove our own sessionID from the tracked sessions
254 254
                 $sessionIds = $this->removeOwnSessionId($res[0]);
255 255
                 $this->setList($sessionIds);
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 $this->calledList = true;
261 261
                 $this->checkStarted();
262 262
             },
263
-            function ($error) {
263
+            function($error) {
264 264
                 $this->emit('error', [$error]);
265 265
             }
266 266
         );
Please login to merge, or discard this patch.