@@ -42,7 +42,7 @@ |
||
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; |
@@ -88,6 +88,6 @@ |
||
88 | 88 | |
89 | 89 | $hash = md5(serialize($request)); |
90 | 90 | |
91 | - return 'videos.' . $hash; |
|
91 | + return 'videos.'.$hash; |
|
92 | 92 | } |
93 | 93 | } |
@@ -194,7 +194,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $enableCache = VideosPlugin::$plugin->getSettings()->enableCache === false ? false : $enableCache; |
119 | 119 | |
120 | 120 | if ($enableCache) { |
121 | - $key = 'videos.video.' . $gatewayHandle . '.' . md5($id); |
|
121 | + $key = 'videos.video.'.$gatewayHandle.'.'.md5($id); |
|
122 | 122 | |
123 | 123 | $response = VideosPlugin::$plugin->getCache()->get([$key]); |
124 | 124 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function requestVideoByUrl($videoUrl, bool $enableCache = true, int $cacheExpiry = null) |
152 | 152 | { |
153 | - $key = 'videos.video.' . md5($videoUrl); |
|
153 | + $key = 'videos.video.'.md5($videoUrl); |
|
154 | 154 | $enableCache = VideosPlugin::$plugin->getSettings()->enableCache === false ? false : $enableCache; |
155 | 155 | |
156 | 156 | if ($enableCache) { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | return $video; |
194 | 194 | } |
195 | 195 | } catch (\Exception $exception) { |
196 | - Craft::info('Couldn’t get video: ' . $exception->getMessage(), __METHOD__); |
|
196 | + Craft::info('Couldn’t get video: '.$exception->getMessage(), __METHOD__); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 |