Completed
Push — master ( 26e625...88c602 )
by Timo
02:58
created
src/Tidal/WampWatch/SessionMonitor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
     public function getSessionInfo($sessionId)
68 68
     {
69 69
         return $this->session->call(self::SESSION_INFO_TOPIC, [$sessionId])->then(
70
-            function ($res) {
70
+            function($res) {
71 71
                 $this->emit('info', [$res]);
72 72
 
73 73
                 return $res;
74 74
             },
75
-            function ($error) {
75
+            function($error) {
76 76
                 $this->emit('error', [$error]);
77 77
             }
78 78
         );
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             return $this->retrieveSessionIds();
92 92
         }
93 93
 
94
-        return new Promise(function (callable $resolve) {
94
+        return new Promise(function(callable $resolve) {
95 95
             $resolve($this->sessionIds);
96 96
         });
97 97
     }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         // @var \Tidal\WampWatch\Subscription\Collection
168 168
         $collection = $this->getMetaSubscriptionCollection();
169 169
 
170
-        $collection->addSubscription(self::SESSION_JOIN_TOPIC, function (array $res) {
170
+        $collection->addSubscription(self::SESSION_JOIN_TOPIC, function(array $res) {
171 171
             $sessionInfo = $res[0];
172 172
             if (!$this->validateSessionInfo($sessionInfo) || $this->hasSession($sessionInfo)) {
173 173
                 return;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             $this->addSession($sessionInfo);
176 176
         });
177 177
 
178
-        $collection->addSubscription(self::SESSION_LEAVE_TOPIC, function (array $res) {
178
+        $collection->addSubscription(self::SESSION_LEAVE_TOPIC, function(array $res) {
179 179
             // @bug : wamp.session.on_leave is bugged as of crossbar.io 0.11.0
180 180
             // will provide sessionID when Browser closes/reloads,
181 181
             // but not when calling connection.close();
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
     protected function getSessionIdRetrievalCallback()
204 204
     {
205
-        return function ($res) {
205
+        return function($res) {
206 206
             // remove our own sessionID from the tracked sessions
207 207
             $sessionIds = $this->removeOwnSessionId($res[0]);
208 208
             $this->setList($sessionIds);
Please login to merge, or discard this patch.
src/Tidal/WampWatch/Subscription/Collection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     protected function doSubscribe()
103 103
     {
104
-        \React\Promise\all($this->getSubscriptionPromises())->done(function () {
104
+        \React\Promise\all($this->getSubscriptionPromises())->done(function() {
105 105
             $this->isSubscribed = true;
106 106
             $this->isSubscribing = false;
107 107
             $this->subscriptionPromise->resolve($this->subscriptions);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
         foreach (array_keys($this->subscriptions) as $topic) {
119 119
             $promises[] = $this->session->subscribe($topic, $this->subscriptionCallbacks[$topic])
120
-                ->then(function (SubscribedMessage $msg) use ($topic) {
120
+                ->then(function(SubscribedMessage $msg) use ($topic) {
121 121
                     $this->subscriptions[$topic] = $msg->getSubscriptionId();
122 122
                     $this->subscriptionPromise->notify($topic);
123 123
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function unsubscribe()
135 135
     {
136
-        $resolver = function (callable $resolve) {
136
+        $resolver = function(callable $resolve) {
137 137
             $resolve();
138 138
         };
139 139
         $promise = new  Promise($resolver);
Please login to merge, or discard this patch.
src/Tidal/WampWatch/MonitorTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             $this->callInitialProcedure(),
80 80
         ];
81 81
 
82
-        \React\Promise\all($promises)->done(function () {
82
+        \React\Promise\all($promises)->done(function() {
83 83
             $this->isRunning = true;
84 84
             $this->emit('start', [$this->getList()]);
85 85
         });
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
         if (!isset($this->initialCallProcedure) || !isset($this->initialCallCallback)) {
165 165
             $this->initialCallDone = true;
166 166
 
167
-            return new  Promise(function (callable $resolve) {
167
+            return new  Promise(function(callable $resolve) {
168 168
                 $resolve();
169 169
             });
170 170
         }
171 171
 
172
-        return $this->session->call($this->initialCallProcedure, [])->then(function ($res) {
172
+        return $this->session->call($this->initialCallProcedure, [])->then(function($res) {
173 173
             $this->initialCallDone = true;
174 174
             $cb = $this->initialCallCallback;
175 175
             $cb($res);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
     private function getErrorCallback()
184 184
     {
185
-        return function ($error) {
185
+        return function($error) {
186 186
             $this->emit('error', [$error]);
187 187
 
188 188
             return $error;
Please login to merge, or discard this patch.
src/Tidal/WampWatch/SubscriptionMonitor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function getSubscriptionInfo($topic)
62 62
     {
63 63
         return $this->session->call(self::SUBSCRIPTION_GET_TOPIC, [$topic])->then(
64
-            function ($res) {
64
+            function($res) {
65 65
                 $this->emit('info', [$res]);
66 66
 
67 67
                 return $res;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             return $this->retrieveSubscriptionIds();
77 77
         }
78 78
 
79
-        return new Promise(function (callable $resolve) {
79
+        return new Promise(function(callable $resolve) {
80 80
             $resolve($this->subscriptionIds);
81 81
         });
82 82
     }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
     private function getCreateHandler()
101 101
     {
102
-        return function ($res) {
102
+        return function($res) {
103 103
             $sessionId = $res[0];
104 104
             $subscriptionInfo = $res[1];
105 105
             $this->emit('create', [$sessionId, $subscriptionInfo]);
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
     private function getSubscriptionHandler($event)
110 110
     {
111
-        return function ($res) use ($event) {
111
+        return function($res) use ($event) {
112 112
             $sessionId = $res[0];
113 113
             $subscriptionId = $res[1];
114 114
             $this->emit($event, [$sessionId, $subscriptionId]);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     protected function getSubscriptionIdRetrievalCallback()
138 138
     {
139
-        return function (\Thruway\CallResult $res) {
139
+        return function(\Thruway\CallResult $res) {
140 140
             /** @var \Thruway\Message\ResultMessage $message */
141 141
             $message = $res->getResultMessage();
142 142
             $list = $message->getArguments()[0];
Please login to merge, or discard this patch.
src/Tidal/WampWatch/Model/Behavior/Property/HasCollectionsTrait.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -44,6 +44,9 @@
 block discarded – undo
44 44
         return $this->{$name};
45 45
     }
46 46
 
47
+    /**
48
+     * @param string $name
49
+     */
47 50
     private function hasCollection($name)
48 51
     {
49 52
         return property_exists($this, $name) && is_a($this->{$name}, CollectionInterface::class);
Please login to merge, or discard this patch.
src/Tidal/WampWatch/Model/Contract/RouterInterface.php 1 patch
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,12 +16,13 @@
 block discarded – undo
16 16
 interface RouterInterface
17 17
 {
18 18
     /**
19
-     * @return string;
19
+     * @return string
20 20
      */
21 21
     public function getUri();
22 22
 
23 23
     /**
24 24
      * @param RealmInterface $realm
25
+     * @return void
25 26
      */
26 27
     public function addRealm(Contract\RealmInterface $realm);
27 28
 
Please login to merge, or discard this patch.
src/Tidal/WampWatch/Model/Router.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,6 +66,6 @@
 block discarded – undo
66 66
     }
67 67
 }
68 68
 
69
-Router::setConnectionFactory(function (Contract\RouterInterface $router, Contract\RealmInterface $realm) {
69
+Router::setConnectionFactory(function(Contract\RouterInterface $router, Contract\RealmInterface $realm) {
70 70
     return new Connection($router, $realm);
71 71
 });
Please login to merge, or discard this patch.