Passed
Branch master (03ab13)
by Timo
03:14
created
src/Tidal/WampWatch/SessionMonitor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function start()
52 52
     {
53
-        $this->once('list', function () {
53
+        $this->once('list', function() {
54 54
             $this->doStart();
55 55
         });
56 56
         $this->startSubscriptions();
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
     public function getSessionInfo($sessionId, callable $callback)
86 86
     {
87 87
         return $this->session->call(self::SESSION_INFO_TOPIC, [$sessionId])->then(
88
-            function ($res) use ($callback) {
88
+            function($res) use ($callback) {
89 89
                 $this->emit('info', [$res[0]]);
90 90
                 $callback($res[0]);
91 91
             },
92
-            function ($error) {
92
+            function($error) {
93 93
                 $this->emit('error', [$error]);
94 94
             }
95 95
         );
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     protected function startSubscriptions()
122 122
     {
123
-        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function ($res) {
123
+        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function($res) {
124 124
             $sessionInfo = $res[0];
125 125
             $sessionId = $sessionInfo->session;
126 126
             if ((array_search($sessionId, $this->sessionIds)) === false) {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 $this->emit('join', [$sessionInfo]);
129 129
             }
130 130
         });
131
-        $this->session->subscribe(self::SESSION_LEAVE_TOPIC, function ($res) {
131
+        $this->session->subscribe(self::SESSION_LEAVE_TOPIC, function($res) {
132 132
             // @bug : wamp.session.on_leave is bugged as of crossbar.io 0.11.0
133 133
             // will provide sessionID when Browser closes/reloads,
134 134
             // but not when calling connection.close();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     protected function retrieveSessionIds(callable $callback = null)
158 158
     {
159 159
         $this->session->call(self::SESSION_LIST_TOPIC, [])->then(
160
-            function ($res) use ($callback) {
160
+            function($res) use ($callback) {
161 161
                 // remove our own sessionID from the tracked sessions
162 162
                 $sessionIds = $this->removeOwnSessionId($res[0]);
163 163
                 $this->setList($sessionIds);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                     $callback($this->sessionIds);
167 167
                 }
168 168
             },
169
-            function ($error) {
169
+            function($error) {
170 170
                 $this->emit('error', [$error]);
171 171
             }
172 172
         );
Please login to merge, or discard this patch.
src/Tidal/WampWatch/SubscriptionMonitor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function start()
43 43
     {
44
-        $this->once('list', function () {
44
+        $this->once('list', function() {
45 45
             $this->startSubscriptions();
46 46
             $this->doStart();
47 47
         });
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
     public function getSessionInfo($sessionId, callable $callback)
58 58
     {
59 59
         return $this->session->call(self::SUBSCRIPTION_INFO_TOPIC, $sessionId)->then(
60
-            function ($res) use ($callback) {
60
+            function($res) use ($callback) {
61 61
                 $this->emit('info', $res);
62 62
                 $callback($res[0]);
63 63
             },
64
-            function ($error) {
64
+            function($error) {
65 65
                 $this->emit('error', [$error]);
66 66
             }
67 67
         );
@@ -71,20 +71,20 @@  discard block
 block discarded – undo
71 71
     {
72 72
         if (!count($this->subscriptionIds)) {
73 73
             $this->retrieveSubscriptionIds($callback);
74
-        } else {
74
+        }else {
75 75
             $callback($this->subscriptionIds);
76 76
         }
77 77
     }
78 78
 
79 79
     protected function startSubscriptions()
80 80
     {
81
-        $this->session->subscribe(self::SUBSCRIPTION_CREATE_TOPIC, function ($res) {
81
+        $this->session->subscribe(self::SUBSCRIPTION_CREATE_TOPIC, function($res) {
82 82
             return $this->createHandler($res);
83 83
         });
84
-        $this->session->subscribe(self::SUBSCRIPTION_DELETE_TOPIC, function ($res) {
84
+        $this->session->subscribe(self::SUBSCRIPTION_DELETE_TOPIC, function($res) {
85 85
             return $this->deleteHandler($res);
86 86
         });
87
-        $this->session->subscribe(self::SUBSCRIPTION_SUB_TOPIC, function ($res) {
87
+        $this->session->subscribe(self::SUBSCRIPTION_SUB_TOPIC, function($res) {
88 88
             return $this->subHandler($res);
89 89
         });
90 90
     }
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
         $sessionId = $res[0];
114 114
         $subId = $res[1];
115 115
         $this->getSubscriptionDetail($subId)->then(
116
-            function ($res) use ($sessionId, $subId) {
116
+            function($res) use ($sessionId, $subId) {
117 117
                 $this->emit('sub', [$sessionId, $subId, $res[0]]);
118 118
             },
119
-            function () {
119
+            function() {
120 120
                 $this->emit('sub', [$sessionId, $subId, [
121 121
                     'id'        => $subId,
122 122
                     'created'   => null,
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
     public function getSubscriptionDetail($subId, callable $callback)
137 137
     {
138 138
         return $this->session->call(self::SUBSCRIPTION_GET_TOPIC, [$subId])->then(
139
-            function ($res) use ($callback) {
139
+            function($res) use ($callback) {
140 140
                 $this->emit('info', [$res[0]]);
141 141
                 $callback($res[0]);
142 142
             },
143
-            function ($error) {
143
+            function($error) {
144 144
                 $this->emit('error', [$error]);
145 145
             }
146 146
         );
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
     protected function retrieveSubscriptionIds(callback $callback = null)
150 150
     {
151 151
         return $this->session->call(self::SUBSCRIPTION_LIST_TOPIC, [])->then(
152
-            function ($res) use ($callback) {
152
+            function($res) use ($callback) {
153 153
                 $this->subscriptionIds = $res[0];
154 154
                 $this->emit('list', [$this->subscriptionIds]);
155 155
                 if ($callback) {
156 156
                     $callback($this->subscriptionIds);
157 157
                 }
158 158
             },
159
-            function ($error) {
159
+            function($error) {
160 160
                 $this->emit('error', [$error]);
161 161
             }
162 162
         );
Please login to merge, or discard this patch.