@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function register() |
22 | 22 | { |
23 | - $this->app->singleton(OpenVidu::class, function () { |
|
23 | + $this->app->singleton(OpenVidu::class, function() { |
|
24 | 24 | return new OpenVidu(/** @scrutinizer ignore-call */ config('services.openvidu')); |
25 | 25 | }); |
26 | 26 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | private function registerRoutes() |
37 | 37 | { |
38 | - Route::group($this->routeConfiguration(), function () { |
|
39 | - $this->loadRoutesFrom(__DIR__.'/../Http/routes.php'); |
|
38 | + Route::group($this->routeConfiguration(), function() { |
|
39 | + $this->loadRoutesFrom(__DIR__ . '/../Http/routes.php'); |
|
40 | 40 | }); |
41 | 41 | } |
42 | 42 | |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | public function boot() |
63 | 63 | { |
64 | 64 | if ($this->app->runningInConsole()) { |
65 | - $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); |
|
65 | + $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); |
|
66 | 66 | |
67 | 67 | $this->publishes([ |
68 | - __DIR__.'/../../database/migrations' => /** @scrutinizer ignore-call */ database_path('migrations'), |
|
68 | + __DIR__ . '/../../database/migrations' => /** @scrutinizer ignore-call */ database_path('migrations'), |
|
69 | 69 | ], 'openvidu-migrations'); |
70 | 70 | |
71 | 71 | } |
72 | - Cache::extend('openvidu', function () { |
|
72 | + Cache::extend('openvidu', function() { |
|
73 | 73 | return Cache::repository(new SessionStore(DB::connection(), /** @scrutinizer ignore-call */ config('cache.stores.openvidu.table'))); |
74 | 74 | }); |
75 | 75 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function unpublish(string $streamId) |
125 | 125 | { |
126 | - $this->publishers = array_filter($this->publishers, function (Publisher $publisher) use ($streamId) { |
|
126 | + $this->publishers = array_filter($this->publishers, function(Publisher $publisher) use ($streamId) { |
|
127 | 127 | return $streamId !== $publisher->getStreamId(); |
128 | 128 | }); |
129 | 129 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | public function unsubscribe(string $streamId) |
136 | 136 | { |
137 | 137 | if (!empty($this->subscribers)) { |
138 | - $this->subscribers = array_filter($this->subscribers, function (Subscriber $subscriber) use ($streamId) { |
|
138 | + $this->subscribers = array_filter($this->subscribers, function(Subscriber $subscriber) use ($streamId) { |
|
139 | 139 | return $subscriber->getPublisherStreamId() !== $streamId; |
140 | 140 | }); |
141 | 141 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | if (array_key_exists('session', $properties)) { |
26 | 26 | return new SignalProperties( |
27 | - $properties['session'], |
|
27 | + $properties['session'], |
|
28 | 28 | array_key_exists('data', $properties) ? $properties['data'] : null, |
29 | 29 | array_key_exists('type', $properties) ? $properties['type'] : null, |
30 | 30 | array_key_exists('to', $properties) ? $properties['to'] : null |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'auth' => [ |
75 | 75 | $this->config['app'], $this->config['secret'] |
76 | 76 | ], |
77 | - 'base_uri' => $this->config['domain'].':'.$this->config['port'], |
|
77 | + 'base_uri' => $this->config['domain'] . ':' . $this->config['port'], |
|
78 | 78 | 'debug' => $this->config['debug'], |
79 | 79 | 'http_errors' => false, |
80 | 80 | 'verify' => false |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | case 501: |
137 | 137 | throw new OpenViduServerRecordingIsDisabledException(); |
138 | 138 | default: |
139 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
139 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -166,14 +166,14 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function getRecording(string $recordingId): Recording |
168 | 168 | { |
169 | - $response = $this->client()->get(Uri::RECORDINGS_URI.'/'.$recordingId); |
|
169 | + $response = $this->client()->get(Uri::RECORDINGS_URI . '/' . $recordingId); |
|
170 | 170 | switch ($response->getStatusCode()) { |
171 | 171 | case 200: |
172 | 172 | return RecordingBuilder::build(json_decode($response->getBody()->getContents(), true)); |
173 | 173 | case 404: |
174 | 174 | throw new OpenViduRecordingNotFoundException(); |
175 | 175 | default: |
176 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
176 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function stopRecording(string $recordingId): Recording |
203 | 203 | { |
204 | - $response = $this->client()->post(Uri::RECORDINGS_STOP.'/'.$recordingId); |
|
204 | + $response = $this->client()->post(Uri::RECORDINGS_STOP . '/' . $recordingId); |
|
205 | 205 | switch ($response->getStatusCode()) { |
206 | 206 | case 200: |
207 | 207 | $recording = RecordingBuilder::build(json_decode($response->getBody()->getContents(), true)); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | case 406: |
217 | 217 | throw new OpenViduRecordingStatusException("The recording has `starting` status. Wait until `started` status before stopping the recording."); |
218 | 218 | default: |
219 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
219 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | } |
239 | 239 | return $recordings; |
240 | 240 | default: |
241 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
241 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function deleteRecording(string $recordingId): bool |
255 | 255 | { |
256 | - $response = $this->client()->delete(Uri::RECORDINGS_URI.'/'.$recordingId); |
|
256 | + $response = $this->client()->delete(Uri::RECORDINGS_URI . '/' . $recordingId); |
|
257 | 257 | |
258 | 258 | switch ($response->getStatusCode()) { |
259 | 259 | case 200: |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | throw new OpenViduRecordingStatusException("The recording has `started` status. Stop it before deletion."); |
266 | 266 | break; |
267 | 267 | default: |
268 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
268 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 | |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | case 406: |
329 | 329 | throw new OpenViduSessionHasNotConnectedParticipantsException(); |
330 | 330 | default: |
331 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
331 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | } |
@@ -18,6 +18,6 @@ |
||
18 | 18 | |
19 | 19 | public function __toString() |
20 | 20 | { |
21 | - return __CLASS__.":[{$this->code}]:{$this->message}\n"; |
|
21 | + return __CLASS__ . ":[{$this->code}]:{$this->message}\n"; |
|
22 | 22 | } |
23 | 23 | } |
@@ -18,6 +18,6 @@ |
||
18 | 18 | |
19 | 19 | public function __toString() |
20 | 20 | { |
21 | - return __CLASS__.":[{$this->code}]:{$this->message}\n"; |
|
21 | + return __CLASS__ . ":[{$this->code}]:{$this->message}\n"; |
|
22 | 22 | } |
23 | 23 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | case 409: |
83 | 83 | return $this->properties->getCustomSessionId(); |
84 | 84 | default: |
85 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
85 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
86 | 86 | } |
87 | 87 | } else { |
88 | 88 | return $this->sessionId; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | case 404: |
117 | 117 | throw new OpenViduSessionNotFoundException(); |
118 | 118 | default: |
119 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
119 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
120 | 120 | } |
121 | 121 | } catch (Exception $e) { |
122 | 122 | throw new OpenViduTokenCantCreateException($e->getMessage(), $e); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function close() |
132 | 132 | { |
133 | - $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId); |
|
133 | + $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId); |
|
134 | 134 | switch ($response->getStatusCode()) { |
135 | 135 | case 204: |
136 | 136 | Cache::store('openvidu')->forget($this->sessionId); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | case 404: |
139 | 139 | throw new OpenViduSessionNotFoundException(); |
140 | 140 | default: |
141 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
141 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | public function fetch() |
162 | 162 | { |
163 | - $response = $this->client->get(Uri::SESSION_URI.'/'.$this->sessionId, [ |
|
163 | + $response = $this->client->get(Uri::SESSION_URI . '/' . $this->sessionId, [ |
|
164 | 164 | 'headers' => [ |
165 | 165 | 'Content-Type' => 'application/x-www-form-urlencoded', |
166 | 166 | 'Accept' => 'application/json', |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | public function forceDisconnect(string $connectionId) |
277 | 277 | { |
278 | - $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId.'/connection/'.$connectionId, [ |
|
278 | + $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId . '/connection/' . $connectionId, [ |
|
279 | 279 | 'headers' => [ |
280 | 280 | 'Content-Type' => 'application/x-www-form-urlencoded', |
281 | 281 | 'Accept' => 'application/json', |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | case 404: |
292 | 292 | throw new OpenViduConnectionNotFoundException(); |
293 | 293 | default: |
294 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
294 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
295 | 295 | } |
296 | 296 | } |
297 | 297 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | private function leaveSession(string $connectionId) |
305 | 305 | { |
306 | 306 | $connectionClosed = null; |
307 | - $this->activeConnections = array_filter($this->activeConnections, function (Connection $connection) use (&$connectionClosed, $connectionId) { |
|
307 | + $this->activeConnections = array_filter($this->activeConnections, function(Connection $connection) use (&$connectionClosed, $connectionId) { |
|
308 | 308 | if ($connection->getConnectionId() !== $connectionId) { |
309 | 309 | return true; |
310 | 310 | } |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function publish(IPCameraOptions $IPCameraOptions) |
336 | 336 | { |
337 | - $response = $this->client->post(Uri::SESSION_URI.'/'.$this->sessionId.'/connection', [ |
|
337 | + $response = $this->client->post(Uri::SESSION_URI . '/' . $this->sessionId . '/connection', [ |
|
338 | 338 | RequestOptions::JSON => array_merge($IPCameraOptions->toArray()) |
339 | 339 | ]); |
340 | 340 | switch ($response->getStatusCode()) { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function forceUnpublish(string $streamId) |
373 | 373 | { |
374 | - $response = $this->client->delete(Uri::SESSION_URI.'/'.$this->sessionId.'/stream/'.$streamId, [ |
|
374 | + $response = $this->client->delete(Uri::SESSION_URI . '/' . $this->sessionId . '/stream/' . $streamId, [ |
|
375 | 375 | 'headers' => [ |
376 | 376 | 'Content-Type' => 'application/x-www-form-urlencoded', |
377 | 377 | 'Accept' => 'application/json', |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | case 405: |
393 | 393 | throw new OpenViduStreamCantCloseException("You cannot directly delete the stream of an IPCAM participant"); |
394 | 394 | default: |
395 | - throw new OpenViduException("Invalid response status code ".$response->getStatusCode(), $response->getStatusCode()); |
|
395 | + throw new OpenViduException("Invalid response status code " . $response->getStatusCode(), $response->getStatusCode()); |
|
396 | 396 | } |
397 | 397 | } |
398 | 398 |