Passed
Push — master ( b2bae2...28c96c )
by Jacobo
03:38
created
src/Session.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function __construct(Client $client, ?string $sessionId = null, ?SessionProperties $properties = null)
62 62
     {
63 63
         $this->client = $client;
64
-        if(!$sessionId) {
64
+        if (!$sessionId) {
65 65
             $this->properties = $properties ? $properties : new SessionProperties(MediaMode::ROUTED, RecordingMode::MANUAL, OutputMode::COMPOSED, RecordingLayout::BEST_FIT);
66 66
             $this->sessionId = $this->getSessionId();
67 67
         }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 case 409:
86 86
                     return $this->properties->getCustomSessionId();
87 87
                 default:
88
-                    throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
88
+                    throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
89 89
             }
90 90
         } else {
91 91
             return $this->sessionId;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 case 404:
120 120
                     throw new OpenViduSessionNotFoundException();
121 121
                 default:
122
-                    throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
122
+                    throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
123 123
             }
124 124
         } catch (Exception $e) {
125 125
             throw new OpenViduTokenCantCreateException($e->getMessage(), $e);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function close()
135 135
     {
136
-        $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId);
136
+        $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId);
137 137
         switch ($response->getStatusCode()) {
138 138
             case 204:
139 139
                 Cache::store('openvidu')->forget($this->sessionId);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             case 404:
142 142
                 throw new OpenViduSessionNotFoundException();
143 143
             default:
144
-                throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
144
+                throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
145 145
         }
146 146
     }
147 147
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
     public function fetch()
165 165
     {
166
-        $response = $this->client->get(Uri::SESSION_URI.'/'.$this->sessionId, [
166
+        $response = $this->client->get(Uri::SESSION_URI . '/' . $this->sessionId, [
167 167
             'headers' => [
168 168
                 'Content-Type' => 'application/x-www-form-urlencoded',
169 169
                 'Accept' => 'application/json',
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     public function forceDisconnect(string $connectionId)
280 280
     {
281
-        $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId.'/connection/'.$connectionId, [
281
+        $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId . '/connection/' . $connectionId, [
282 282
             'headers' => [
283 283
                 'Content-Type' => 'application/x-www-form-urlencoded',
284 284
                 'Accept' => 'application/json',
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
             case 404:
295 295
                 throw new OpenViduConnectionNotFoundException();
296 296
             default:
297
-                throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
297
+                throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
298 298
         }
299 299
     }
300 300
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     private function leaveSession(string $connectionId)
308 308
     {
309 309
         $connectionClosed = null;
310
-        $this->activeConnections = array_filter($this->activeConnections, function (Connection $connection) use (&$connectionClosed, $connectionId) {
310
+        $this->activeConnections = array_filter($this->activeConnections, function(Connection $connection) use (&$connectionClosed, $connectionId) {
311 311
             if ($connection->getConnectionId() !== $connectionId) {
312 312
                 return true;
313 313
             }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     public function publish(IPCameraOptions $IPCameraOptions)
339 339
     {
340
-        $response = $this->client->post(Uri::SESSION_URI.'/'.$this->sessionId.'/connection', [
340
+        $response = $this->client->post(Uri::SESSION_URI . '/' . $this->sessionId . '/connection', [
341 341
             RequestOptions::JSON => array_merge($IPCameraOptions->toArray())
342 342
         ]);
343 343
         switch ($response->getStatusCode()) {
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
      */
375 375
     public function forceUnpublish(string $streamId)
376 376
     {
377
-        $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId.'/stream/'.$streamId, [
377
+        $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId . '/stream/' . $streamId, [
378 378
             'headers' => [
379 379
                 'Content-Type' => 'application/x-www-form-urlencoded',
380 380
                 'Accept' => 'application/json',
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
             case 405:
396 396
                 throw new OpenViduStreamCantCloseException("You cannot directly delete the stream of an IPCAM participant");
397 397
             default:
398
-                throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode());
398
+                throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode());
399 399
         }
400 400
     }
401 401
 
Please login to merge, or discard this patch.