Passed
Pull Request — develop (#85)
by
unknown
06:16
created
src/gateways/Vimeo.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      */
195 195
     public function getVideoById(string $id): Video
196 196
     {
197
-        $data = $this->get('videos/' . $id, [
197
+        $data = $this->get('videos/'.$id, [
198 198
             'query' => [
199 199
                 'fields' => 'created_time,description,duration,height,link,name,pictures,pictures,player_embed_url,privacy,stats,uri,user,width,download,review_link,files'
200 200
             ],
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
         $options = [
275 275
             'base_uri' => $this->getApiUrl(),
276 276
             'headers' => [
277
-                'Accept' => 'application/vnd.vimeo.*+json;version=' . $this->getApiVersion(),
278
-                'Authorization' => 'Bearer ' . $this->getOauthToken()->getToken()
277
+                'Accept' => 'application/vnd.vimeo.*+json;version='.$this->getApiVersion(),
278
+                'Authorization' => 'Bearer '.$this->getOauthToken()->getToken()
279 279
             ],
280 280
         ];
281 281
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
         unset($params['id']);
297 297
 
298 298
         // albums/#album_id
299
-        return $this->performVideosRequest('me/albums/' . $albumId . '/videos', $params);
299
+        return $this->performVideosRequest('me/albums/'.$albumId.'/videos', $params);
300 300
     }
301 301
 
302 302
     /**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         unset($params['id']);
314 314
 
315 315
         // folders/#folder_id
316
-        return $this->performVideosRequest('me/folders/' . $folderId . '/videos', $params);
316
+        return $this->performVideosRequest('me/folders/'.$folderId.'/videos', $params);
317 317
     }
318 318
 
319 319
     /**
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
         $params['channel_id'] = $params['id'];
330 330
         unset($params['id']);
331 331
 
332
-        return $this->performVideosRequest('channels/' . $params['channel_id'] . '/videos', $params);
332
+        return $this->performVideosRequest('channels/'.$params['channel_id'].'/videos', $params);
333 333
     }
334 334
 
335 335
     /**
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                     break;
473 473
 
474 474
                 default:
475
-                    throw new CollectionParsingException('Couldn’t parse collection of type ”' . $type . '“.');
475
+                    throw new CollectionParsingException('Couldn’t parse collection of type ”'.$type.'“.');
476 476
             }
477 477
 
478 478
             $parseCollections[] = $parsedCollection;
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
         $video->description = $data['description'];
567 567
         $video->gatewayHandle = 'vimeo';
568 568
         $video->gatewayName = 'Vimeo';
569
-        $video->id = (int)substr($data['uri'], \strlen('/videos/'));
569
+        $video->id = (int) substr($data['uri'], \strlen('/videos/'));
570 570
         $video->plays = $data['stats']['plays'] ?? 0;
571 571
         $video->title = $data['name'];
572 572
         $video->url = $data['link'];
Please login to merge, or discard this patch.
src/base/Gateway.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
             // Redirect
171 171
             Craft::$app->getSession()->setNotice(Craft::t('videos', 'Connected to {gateway}.', ['gateway' => $this->getName()]));
172 172
         } catch (Exception $exception) {
173
-            Craft::error('Couldn’t connect to video gateway:' . "\r\n"
174
-                . 'Message: ' . "\r\n" . $exception->getMessage() . "\r\n"
175
-                . 'Trace: ' . "\r\n" . $exception->getTraceAsString(), __METHOD__);
173
+            Craft::error('Couldn’t connect to video gateway:'."\r\n"
174
+                . 'Message: '."\r\n".$exception->getMessage()."\r\n"
175
+                . 'Trace: '."\r\n".$exception->getTraceAsString(), __METHOD__);
176 176
 
177 177
             // Failed to get the token credentials or user details.
178 178
             Craft::$app->getSession()->setError($exception->getMessage());
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     public function getEmbedHtml(Video $video, array $options = []): string
228 228
     {
229 229
         $embedAttributes = [
230
-            'title' => 'External video from ' . $this->getHandle(),
230
+            'title' => 'External video from '.$this->getHandle(),
231 231
             'frameborder' => '0',
232 232
             'allowfullscreen' => 'true',
233 233
             'allowscriptaccess' => 'true',
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
         $embedAttributesString = '';
255 255
 
256 256
         foreach ($embedAttributes as $key => $value) {
257
-            $embedAttributesString .= ' ' . $key . '="' . $value . '"';
257
+            $embedAttributesString .= ' '.$key.'="'.$value.'"';
258 258
         }
259 259
 
260
-        return '<iframe src="' . $embedUrl . '"' . $embedAttributesString . '></iframe>';
260
+        return '<iframe src="'.$embedUrl.'"'.$embedAttributesString.'></iframe>';
261 261
     }
262 262
 
263 263
     /**
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
             $options = http_build_query($options);
283 283
 
284
-            $embedUrl .= $queryMark . $options;
284
+            $embedUrl .= $queryMark.$options;
285 285
         }
286 286
 
287 287
         return $embedUrl;
@@ -358,13 +358,13 @@  discard block
 block discarded – undo
358 358
      */
359 359
     public function getVideos($method, $options)
360 360
     {
361
-        $realMethod = 'getVideos' . ucwords($method);
361
+        $realMethod = 'getVideos'.ucwords($method);
362 362
 
363 363
         if (method_exists($this, $realMethod)) {
364 364
             return $this->{$realMethod}($options);
365 365
         }
366 366
 
367
-        throw new GatewayMethodNotFoundException('Gateway method “' . $realMethod . '” not found.');
367
+        throw new GatewayMethodNotFoundException('Gateway method “'.$realMethod.'” not found.');
368 368
     }
369 369
 
370 370
     /**
@@ -425,11 +425,11 @@  discard block
 block discarded – undo
425 425
                 Craft::info('Vimeo X-RateLimit-Remaining: '.Json::encode($response->getHeader('X-RateLimit-Remaining')), __METHOD__);
426 426
             }
427 427
 
428
-            $body = (string)$response->getBody();
428
+            $body = (string) $response->getBody();
429 429
             $data = Json::decode($body);
430 430
         } catch (BadResponseException $badResponseException) {
431 431
             $response = $badResponseException->getResponse();
432
-            $body = (string)$response->getBody();
432
+            $body = (string) $response->getBody();
433 433
 
434 434
             try {
435 435
                 $data = Json::decode($body);
Please login to merge, or discard this patch.