Completed
Pull Request — master (#10)
by Timo
02:55
created
src/Tidal/WampWatch/SubscriptionMonitor.php 1 patch
Spacing   +12 added lines, -12 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
         );
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 
81 81
     protected function startSubscriptions()
82 82
     {
83
-        $this->session->subscribe(self::SUBSCRIPTION_CREATE_TOPIC, function ($res) {
83
+        $this->session->subscribe(self::SUBSCRIPTION_CREATE_TOPIC, function($res) {
84 84
             return $this->createHandler($res);
85 85
         });
86
-        $this->session->subscribe(self::SUBSCRIPTION_DELETE_TOPIC, function ($res) {
86
+        $this->session->subscribe(self::SUBSCRIPTION_DELETE_TOPIC, function($res) {
87 87
             return $this->deleteHandler($res);
88 88
         });
89
-        $this->session->subscribe(self::SUBSCRIPTION_SUB_TOPIC, function ($res) {
89
+        $this->session->subscribe(self::SUBSCRIPTION_SUB_TOPIC, function($res) {
90 90
             return $this->subHandler($res);
91 91
         });
92 92
     }
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
         $sessionId = $res[0];
116 116
         $subId = $res[1];
117 117
         $this->getSubscriptionDetail($subId)->then(
118
-            function ($res) use ($sessionId, $subId) {
118
+            function($res) use ($sessionId, $subId) {
119 119
                 $this->emit('sub', [$sessionId, $subId, $res[0]]);
120 120
             },
121
-            function () {
121
+            function() {
122 122
                 $this->emit('sub', [$sessionId, $subId, [
123 123
                     'id'        => $subId,
124 124
                     'created'   => null,
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
     public function getSubscriptionDetail($subId, callable $callback)
139 139
     {
140 140
         return $this->session->call(self::SUBSCRIPTION_GET_TOPIC, [$subId])->then(
141
-            function ($res) use ($callback) {
141
+            function($res) use ($callback) {
142 142
                 $this->emit('info', [$res[0]]);
143 143
                 $callback($res[0]);
144 144
             },
145
-            function ($error) {
145
+            function($error) {
146 146
                 $this->emit('error', [$error]);
147 147
             }
148 148
         );
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
     protected function retrieveSubscriptionIds(callback $callback = null)
152 152
     {
153 153
         return $this->session->call(self::SUBSCRIPTION_LIST_TOPIC, [])->then(
154
-            function ($res) use ($callback) {
154
+            function($res) use ($callback) {
155 155
                 $this->subscriptionIds = $res[0];
156 156
                 $this->emit('list', [$this->subscriptionIds]);
157 157
                 if ($callback) {
158 158
                     $callback($this->subscriptionIds);
159 159
                 }
160 160
             },
161
-            function ($error) {
161
+            function($error) {
162 162
                 $this->emit('error', [$error]);
163 163
             }
164 164
         );
Please login to merge, or discard this patch.