Passed
Push — master ( c00b75...febabf )
by Jacobo
01:08 queued 11s
created
database/migrations/2019_12_01_000001_create_openvidu_cache_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('openvidu_cache', function (Blueprint $table) {
16
+        Schema::create('openvidu_cache', function(Blueprint $table) {
17 17
             $table->string('key')->unique();
18 18
             $table->text('value');
19 19
             $table->integer('expiration');
Please login to merge, or discard this patch.
src/Connection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
135 135
     public function unsubscribe(string $streamId)
136 136
     {
137 137
         if (!empty($this->subscribers)) {
138
-            $this->subscribers = array_filter($this->subscribers, function ($subscriber) use ($streamId) {
138
+            $this->subscribers = array_filter($this->subscribers, function($subscriber) use ($streamId) {
139 139
                 if (is_string($subscriber)) {
140 140
                     return $subscriber !== $streamId;
141 141
                 }
Please login to merge, or discard this patch.
src/Cache/SessionStore.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             return;
104 104
         }
105 105
 
106
-        $cache = is_array($cache) ? (object) $cache : $cache;
106
+        $cache = is_array($cache) ? (object)$cache : $cache;
107 107
 
108 108
         // If this cache expiration date is past the current time, we will remove this
109 109
         // item from the cache. Then we will return a null value since the cache is
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             return;
163 163
         }
164 164
 
165
-        $cache = is_array($cache) ? (object) $cache : $cache;
165
+        $cache = is_array($cache) ? (object)$cache : $cache;
166 166
         // If this cache expiration date is past the current time, we will remove this
167 167
         // item from the cache. Then we will return a null value since the cache is
168 168
         // expired. We will use "Carbon" to make this comparison with the column.
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      */
190 190
     public function increment($key, $value = 1)
191 191
     {
192
-        return $this->incrementOrDecrement($key, $value, function ($current, $value) {
192
+        return $this->incrementOrDecrement($key, $value, function($current, $value) {
193 193
             return $current + $value;
194 194
         });
195 195
     }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      */
206 206
     protected function incrementOrDecrement($key, $value, Closure $callback)
207 207
     {
208
-        return $this->connection->transaction(function () use ($key, $value, $callback) {
208
+        return $this->connection->transaction(function() use ($key, $value, $callback) {
209 209
 
210 210
 
211 211
             $cache = $this->table()->where('key', $key)
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
                 return false;
219 219
             }
220 220
 
221
-            $cache = is_array($cache) ? (object) $cache : $cache;
221
+            $cache = is_array($cache) ? (object)$cache : $cache;
222 222
 
223 223
             $current = $this->unserialize($cache->value);
224 224
 
225 225
             // Here we'll call this callback function that was given to the function which
226 226
             // is used to either increment or decrement the function. We use a callback
227 227
             // so we do not have to recreate all this logic in each of the functions.
228
-            $new = $callback((int) $current, $value);
228
+            $new = $callback((int)$current, $value);
229 229
 
230 230
             if (!is_numeric($current)) {
231 231
                 return false;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
      */
253 253
     public function decrement($key, $value = 1)
254 254
     {
255
-        return $this->incrementOrDecrement($key, $value, function ($current, $value) {
255
+        return $this->incrementOrDecrement($key, $value, function($current, $value) {
256 256
             return $current - $value;
257 257
         });
258 258
     }
Please login to merge, or discard this patch.
src/Exceptions/OpenViduRecordingResolutionException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
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.
src/Providers/OpenViduServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Exceptions/OpenViduRecordingNotFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Exceptions/OpenViduException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Exceptions/OpenViduTokenCantCreateException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.