Passed
Pull Request — master (#10)
by Jacobo
03:13
created
src/Session.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                 case 409:
75 75
                     return $this->properties->getCustomSessionId();
76 76
                 default:
77
-                    throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
77
+                    throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
78 78
             }
79 79
         } else {
80 80
             return $this->sessionId;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $this->getSessionId();
96 96
         try {
97 97
             if (!$tokenOptions) {
98
-                $tokenOptions = new TokenOptions(OpenViduRole::PUBLISHER);;
98
+                $tokenOptions = new TokenOptions(OpenViduRole::PUBLISHER); ;
99 99
             }
100 100
             $response = $this->client->post(Uri::TOKEN_URI, [
101 101
                 RequestOptions::JSON => array_merge($tokenOptions->toArray(), ['session' => $this->sessionId])
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function close()
115 115
     {
116
-        $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId);
116
+        $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId);
117 117
         switch ($response->getStatusCode()) {
118 118
             case 204:
119 119
                 Cache::store('openvidu')->forget($this->sessionId);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                 throw new OpenViduSessionNotFoundException();
123 123
                 break;
124 124
             default:
125
-                throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
125
+                throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
126 126
         }
127 127
     }
128 128
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
     public function fetch()
146 146
     {
147
-        $response = $this->client->get(Uri::SESSION_URI.'/'.$this->sessionId, [
147
+        $response = $this->client->get(Uri::SESSION_URI . '/' . $this->sessionId, [
148 148
             'headers' => [
149 149
                 'Content-Type' => 'application/x-www-form-urlencoded',
150 150
                 'Accept' => 'application/json',
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      */
259 259
     public function forceDisconnect(string $connectionId)
260 260
     {
261
-        $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId.'/connection/'.$connectionId, [
261
+        $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId . '/connection/' . $connectionId, [
262 262
             'headers' => [
263 263
                 'Content-Type' => 'application/x-www-form-urlencoded',
264 264
                 'Accept' => 'application/json',
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                 throw new OpenViduConnectionNotFoundException();
277 277
                 break;
278 278
             default:
279
-                throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
279
+                throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
280 280
         }
281 281
     }
282 282
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     private function leaveSession(string $connectionId)
290 290
     {
291 291
         $connectionClosed = null;
292
-        $this->activeConnections = array_filter($this->activeConnections, function (Connection $connection) use (&$connectionClosed, $connectionId) {
292
+        $this->activeConnections = array_filter($this->activeConnections, function(Connection $connection) use (&$connectionClosed, $connectionId) {
293 293
             if ($connection->getConnectionId() !== $connectionId) {
294 294
                 return true;
295 295
             }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
      */
328 328
     public function forceUnpublish(string $streamId)
329 329
     {
330
-        $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId.'/stream/'.$streamId, [
330
+        $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId . '/stream/' . $streamId, [
331 331
             'headers' => [
332 332
                 'Content-Type' => 'application/x-www-form-urlencoded',
333 333
                 'Accept' => 'application/json',
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                 throw new OpenViduConnectionNotFoundException();
349 349
                 break;
350 350
             default:
351
-                throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
351
+                throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
352 352
         }
353 353
     }
354 354
 
Please login to merge, or discard this patch.