Completed
Push — master ( 2651dd...a129fb )
by Timo
23s
created
src/Tidal/WampWatch/MonitorTrait.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -135,6 +135,9 @@
 block discarded – undo
135 135
             : $this->subscriptionCollection = new SubscriptionCollection($this->session);
136 136
     }
137 137
 
138
+    /**
139
+     * @param string $pocedure
140
+     */
138 141
     protected function setInitialCall($pocedure, callable $callback)
139 142
     {
140 143
         $this->initialCallProcedure = (string)$pocedure;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -147,14 +147,14 @@
 block discarded – undo
147 147
     protected function callInitialProcedure()
148 148
     {
149 149
         if (!isset($this->initialCallProcedure) || !isset($this->initialCallCallback)) {
150
-            $resolver = function (callable $resolve) {
150
+            $resolver = function(callable $resolve) {
151 151
                 $resolve();
152 152
             };
153 153
 
154 154
             return new  Promise($resolver);
155 155
         }
156 156
 
157
-        return $this->session->call($this->initialCallProcedure)->then(function ($res) {
157
+        return $this->session->call($this->initialCallProcedure)->then(function($res) {
158 158
             $this->initialCallDone = true;
159 159
 
160 160
             return $res;
Please login to merge, or discard this patch.
src/Tidal/WampWatch/SessionMonitor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function start()
70 70
     {
71 71
         $this->initSetupCalls();
72
-        $this->getSubscriptionCollection()->subscribe()->done(function () {
72
+        $this->getSubscriptionCollection()->subscribe()->done(function() {
73 73
             $this->checkStarted();
74 74
         });
75 75
         $this->retrieveSessionIds();
@@ -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
         );
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         // @var \Tidal\WampWatch\Subscription\Collection
206 206
         $collection = $this->getSubscriptionCollection();
207 207
 
208
-        $collection->addSubscription(self::SESSION_JOIN_TOPIC, function (array $res) {
208
+        $collection->addSubscription(self::SESSION_JOIN_TOPIC, function(array $res) {
209 209
             $sessionInfo = $res[0];
210 210
             if (!$this->validateSessionInfo($sessionInfo) || $this->hasSession($sessionInfo)) {
211 211
                 return;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             $this->addSession($sessionInfo);
214 214
         });
215 215
 
216
-        $collection->addSubscription(self::SESSION_LEAVE_TOPIC, function (array $res) {
216
+        $collection->addSubscription(self::SESSION_LEAVE_TOPIC, function(array $res) {
217 217
             // @bug : wamp.session.on_leave is bugged as of crossbar.io 0.11.0
218 218
             // will provide sessionID when Browser closes/reloads,
219 219
             // but not when calling connection.close();
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $this->session->call(self::SESSION_LIST_TOPIC, [])
235 235
             ->then(
236 236
                 $this->getSessionIdRetrievalCallback()
237
-            )->done(function ($res) use ($callback) {
237
+            )->done(function($res) use ($callback) {
238 238
                 if ($callback !== null) {
239 239
                     $callback($res);
240 240
                 }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
     protected function getSessionIdRetrievalCallback()
245 245
     {
246
-        return function ($res) {
246
+        return function($res) {
247 247
             // remove our own sessionID from the tracked sessions
248 248
             $sessionIds = $this->removeOwnSessionId($res[0]);
249 249
             $this->setList($sessionIds);
Please login to merge, or discard this patch.
src/Tidal/WampWatch/Subscription/Collection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         foreach (array_keys($this->subscriptions) as $topic) {
97 97
             $this->session->subscribe($topic, $this->subscriptionCallbacks[$topic])
98
-                ->done(function (SubscribedMessage $msg) use ($topic) {
98
+                ->done(function(SubscribedMessage $msg) use ($topic) {
99 99
 
100 100
                     $this->subscriptions[$topic] = $msg->getSubscriptionId();
101 101
                     $this->subscriptionPromise->notify($topic);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function unsubscribe()
112 112
     {
113
-        $resolver = function (callable $resolve) {
113
+        $resolver = function(callable $resolve) {
114 114
             $resolve();
115 115
         };
116 116
         $promise = new  Promise($resolver);
Please login to merge, or discard this patch.