Passed
Push — develop ( 80a339...27b363 )
by Benjamin
08:22
created
src/web/assets/videos/VideosAsset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         ];
29 29
 
30 30
         if (!Plugin::getInstance()->getVideos()->useDevServer) {
31
-            $this->sourcePath = __DIR__ . '/dist';
31
+            $this->sourcePath = __DIR__.'/dist';
32 32
             $this->js[] = 'main.js';
33 33
             $this->css[] = 'css/main.css';
34 34
         } else {
Please login to merge, or discard this patch.
src/web/twig/variables/VideosVariable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         try {
43 43
             return Videos::$plugin->getVideos()->getVideoByUrl($videoUrl, $enableCache, $cacheExpiry);
44 44
         } catch (\Exception $exception) {
45
-            Craft::info('Couldn’t get video from its url (' . $videoUrl . '): ' . $exception->getMessage(), __METHOD__);
45
+            Craft::info('Couldn’t get video from its url ('.$videoUrl.'): '.$exception->getMessage(), __METHOD__);
46 46
         }
47 47
 
48 48
         return null;
Please login to merge, or discard this patch.
src/Plugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
             $event->options[] = [
177 177
                 'key' => 'videos-caches',
178 178
                 'label' => Craft::t('videos', 'Videos caches'),
179
-                'action' => Craft::$app->path->getRuntimePath() . '/videos'
179
+                'action' => Craft::$app->path->getRuntimePath().'/videos'
180 180
             ];
181 181
         });
182 182
     }
Please login to merge, or discard this patch.
src/services/Cache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,6 +88,6 @@
 block discarded – undo
88 88
 
89 89
         $hash = md5(serialize($request));
90 90
 
91
-        return 'videos.' . $hash;
91
+        return 'videos.'.$hash;
92 92
     }
93 93
 }
Please login to merge, or discard this patch.
src/migrations/m200925_135118_refactor_oauth_provider_options.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
             // Rebuild OAuth provider options
38 38
             foreach ($oauthProviderOptions as $providerHandle => $provider) {
39
-                $projectConfig->set('plugins.videos.settings.oauthProviderOptions.' . $providerHandle, $provider, sprintf('Save the “%s” provider', $providerHandle));
39
+                $projectConfig->set('plugins.videos.settings.oauthProviderOptions.'.$providerHandle, $provider, sprintf('Save the “%s” provider', $providerHandle));
40 40
             }
41 41
         }
42 42
     }
Please login to merge, or discard this patch.
src/controllers/SettingsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
         ];
136 136
 
137 137
         $key = 'plugins.videos.settings.oauthProviderOptions';
138
-        $configPath = $key . '.' . $gateway->getHandle();
138
+        $configPath = $key.'.'.$gateway->getHandle();
139 139
 
140 140
         Craft::$app->getProjectConfig()->set($configPath, $configData, sprintf('Save the “%s” integration', $gateway->getHandle()));
141 141
 
Please login to merge, or discard this patch.
src/fields/Video.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
         $id = Html::id($name);
56 56
 
57 57
         // Init CSRF Token
58
-        $jsTemplate = 'window.csrfTokenName = "' . Craft::$app->getConfig()->getGeneral()->csrfTokenName . '";';
59
-        $jsTemplate .= 'window.csrfTokenValue = "' . Craft::$app->getRequest()->getCsrfToken() . '";';
58
+        $jsTemplate = 'window.csrfTokenName = "'.Craft::$app->getConfig()->getGeneral()->csrfTokenName.'";';
59
+        $jsTemplate .= 'window.csrfTokenValue = "'.Craft::$app->getRequest()->getCsrfToken().'";';
60 60
         $js = $view->renderString($jsTemplate);
61 61
         $view->registerJs($js);
62 62
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
         // Instantiate Videos Field
94 94
         // $view->registerJs('new Videos.Field("'.$view->namespaceInputId($id).'");');
95
-        $view->registerJs('new VideoFieldConstructor({data: {fieldVariables: ' . \json_encode($variables) . '}}).$mount("#' . $view->namespaceInputId($id) . '-vue");');
95
+        $view->registerJs('new VideoFieldConstructor({data: {fieldVariables: '.\json_encode($variables).'}}).$mount("#'.$view->namespaceInputId($id).'-vue");');
96 96
 
97 97
         return $view->renderTemplate('videos/_components/fieldtypes/Video/input', $variables);
98 98
     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                 return $video;
134 134
             }
135 135
         } catch (\Exception $exception) {
136
-            Craft::info("Couldn't get video in field normalizeValue: " . $exception->getMessage(), __METHOD__);
136
+            Craft::info("Couldn't get video in field normalizeValue: ".$exception->getMessage(), __METHOD__);
137 137
         }
138 138
 
139 139
         return null;
Please login to merge, or discard this patch.
src/gateways/Vimeo.php 1 patch
Spacing   +9 added lines, -9 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,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,10 +566,10 @@  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
-        $video->url = 'https://vimeo.com/' . substr($data['uri'], 8);
572
+        $video->url = 'https://vimeo.com/'.substr($data['uri'], 8);
573 573
         $video->width = $data['width'];
574 574
         $video->height = $data['height'];
575 575
 
Please login to merge, or discard this patch.
src/gateways/YouTube.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         $options = [
268 268
             'base_uri' => $this->getApiUrl(),
269 269
             'headers' => [
270
-                'Authorization' => 'Bearer ' . $this->getOauthToken()->getToken()
270
+                'Authorization' => 'Bearer '.$this->getOauthToken()->getToken()
271 271
             ]
272 272
         ];
273 273
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
         $video = new Video;
605 605
         $video->raw = $data;
606 606
         $video->authorName = $data['snippet']['channelTitle'];
607
-        $video->authorUrl = 'http://youtube.com/channel/' . $data['snippet']['channelId'];
607
+        $video->authorUrl = 'http://youtube.com/channel/'.$data['snippet']['channelId'];
608 608
         $video->date = strtotime($data['snippet']['publishedAt']);
609 609
         $video->description = $data['snippet']['description'];
610 610
         $video->gatewayHandle = 'youtube';
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
         $video->id = $data['id'];
613 613
         $video->plays = $data['statistics']['viewCount'];
614 614
         $video->title = $data['snippet']['title'];
615
-        $video->url = 'http://youtu.be/' . $video->id;
615
+        $video->url = 'http://youtu.be/'.$video->id;
616 616
 
617 617
         // Video Duration
618 618
         $interval = new \DateInterval($data['contentDetails']['duration']);
619
-        $video->durationSeconds = (int)date_create('@0')->add($interval)->getTimestamp();
619
+        $video->durationSeconds = (int) date_create('@0')->add($interval)->getTimestamp();
620 620
         $video->duration8601 = $data['contentDetails']['duration'];
621 621
 
622 622
         // Thumbnails
Please login to merge, or discard this patch.