Completed
Push — master ( 4ffd27...33ccdc )
by Timo
42s
created
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 ($error) {
119
+            function($error) {
120 120
                 $this->emit('sub', [$sessionId, $subId, [
121 121
                     'id'        => $subId,
122 122
                     'created'   => null,
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
     public function getSubscriptionDetail($subId)
137 137
     {
138 138
         return $this->session->call(self::SUBSCRIPTION_GET_TOPIC, [$subId])->then(
139
-            function ($res) {
139
+            function($res) {
140 140
             },
141
-            function ($error) {
141
+            function($error) {
142 142
             }
143 143
         );
144 144
     }
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
     protected function retrieveSubscriptionIds($callback = null)
147 147
     {
148 148
         return $this->session->call(self::SUBSCRIPTION_LIST_TOPIC, [])->then(
149
-            function ($res) use ($callback) {
149
+            function($res) use ($callback) {
150 150
                 $this->subscriptionIds = $res[0];
151 151
                 $this->emit('list', [$this->subscriptionIds]);
152 152
                 if ($callback) {
153 153
                     $callback($this->subscriptionIds);
154 154
                 }
155 155
             },
156
-            function ($error) {
156
+            function($error) {
157 157
                 $this->emit('error', [$error]);
158 158
             }
159 159
         );
Please login to merge, or discard this patch.
src/Tidal/WampWatch/SessionMonitor.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function start()
38 38
     {
39
-        $this->once('list', function () {
39
+        $this->once('list', function() {
40 40
             $this->doStart();
41 41
         });
42 42
         $this->startSubscriptions();
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
     public function getSessionInfo($sessionId, callable $callback)
55 55
     {
56 56
         return $this->session->call(self::SESSION_INFO_TOPIC, [$sessionId])->then(
57
-            function ($res) use ($callback) {
57
+            function($res) use ($callback) {
58 58
                 $this->emit('info', [$res[0]]);
59 59
                 $callback($res[0]);
60 60
             },
61
-            function ($error) {
61
+            function($error) {
62 62
                 $this->emit('error', [$error]);
63 63
             }
64 64
         );
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
     {
69 69
         if (!count($this->sessionIds)) {
70 70
             $this->retrieveSessionIds($callback);
71
-        } else {
71
+        }else {
72 72
             $callback($this->sessionIds);
73 73
         }
74 74
     }
75 75
 
76 76
     protected function startSubscriptions()
77 77
     {
78
-        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function ($res) {
78
+        $this->session->subscribe(self::SESSION_JOIN_TOPIC, function($res) {
79 79
             $sessionInfo = $res[0];
80 80
             $sessionId = $sessionInfo['session'];
81 81
             if ((array_search($sessionId, $this->sessionIds)) === false) {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                 $this->emit('join', [$sessionInfo]);
84 84
             }
85 85
         });
86
-        $this->session->subscribe(self::SESSION_LEAVE_TOPIC, function ($res) {
86
+        $this->session->subscribe(self::SESSION_LEAVE_TOPIC, function($res) {
87 87
             // @bug : wamp.session.on_leave is bugged as of crossbar.io 0.11.0
88 88
             // will provide sessionID when Browser closes/reloads,
89 89
             // but not when calling connection.close();
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
     protected function retrieveSessionIds($callback = null)
105 105
     {
106 106
         $this->session->call(self::SESSION_LIST_TOPIC, [])->then(
107
-            function ($res) use ($callback) {
107
+            function($res) use ($callback) {
108 108
                 $this->sessionIds = $res[0];
109 109
                 $this->emit('list', [$this->sessionIds]);
110 110
                 if ($callback) {
111 111
                     $callback($this->sessionIds);
112 112
                 }
113 113
             },
114
-            function ($error) {
114
+            function($error) {
115 115
                 $this->emit('error', [$error]);
116 116
             }
117 117
         );
Please login to merge, or discard this patch.