Completed
Pull Request — master (#20)
by Timo
02:50
created
src/Tidal/WampWatch/SessionMonitor.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
     public function getSessionInfo($sessionId, callable $callback = null)
103 103
     {
104 104
         return $this->session->call(self::SESSION_INFO_TOPIC, [$sessionId])->then(
105
-            function ($res) use ($callback) {
105
+            function($res) use ($callback) {
106 106
                 $this->emit('info', [$res[0]]);
107 107
                 if ($callback !== null) {
108 108
                     $callback($res[0]);
109 109
                 }
110 110
             },
111
-            function ($error) {
111
+            function($error) {
112 112
                 $this->emit('error', [$error]);
113 113
             }
114 114
         );
@@ -203,27 +203,27 @@  discard block
 block discarded – undo
203 203
     protected function startSubscriptions()
204 204
     {
205 205
         // subscription to 'wamp.session.on_join'
206
-        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function (array $res) {
206
+        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function(array $res) {
207 207
             $sessionInfo = $res[0];
208 208
             if (!$this->validateSessionInfo($sessionInfo) || $this->hasSession($sessionInfo)) {
209 209
                 return;
210 210
             }
211 211
             $this->addSession($sessionInfo);
212 212
 
213
-        })->then(function ($msg) {
213
+        })->then(function($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
-            $sessionId = (int)$res[0];
223
+            $sessionId = (int) $res[0];
224 224
             $this->removeSessionId($sessionId);
225 225
 
226
-        })->then(function ($msg) {
226
+        })->then(function($msg) {
227 227
             $this->leaveSubscriptionId = $msg->getSubscriptionId();
228 228
             $this->checkStarted();
229 229
         });
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     protected function retrieveSessionIds(callable $callback = null)
251 251
     {
252 252
         $this->session->call(self::SESSION_LIST_TOPIC, [])->then(
253
-            function ($res) use ($callback) {
253
+            function($res) use ($callback) {
254 254
                 // remove our own sessionID from the tracked sessions
255 255
                 $sessionIds = $this->removeOwnSessionId($res[0]);
256 256
                 $this->setList($sessionIds);
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 $this->calledList = true;
262 262
                 $this->checkStarted();
263 263
             },
264
-            function ($error) {
264
+            function($error) {
265 265
                 $this->emit('error', [$error]);
266 266
             }
267 267
         );
Please login to merge, or discard this patch.