@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | // Redirect |
| 170 | 170 | Craft::$app->getSession()->setNotice(Craft::t('videos', 'Connected to {gateway}.', ['gateway' => $this->getName()])); |
| 171 | 171 | } catch (Exception $exception) { |
| 172 | - Craft::error('Couldn’t connect to video gateway:' . "\r\n" |
|
| 173 | - . 'Message: ' . "\r\n" . $exception->getMessage() . "\r\n" |
|
| 174 | - . 'Trace: ' . "\r\n" . $exception->getTraceAsString(), __METHOD__); |
|
| 172 | + Craft::error('Couldn’t connect to video gateway:'."\r\n" |
|
| 173 | + . 'Message: '."\r\n".$exception->getMessage()."\r\n" |
|
| 174 | + . 'Trace: '."\r\n".$exception->getTraceAsString(), __METHOD__); |
|
| 175 | 175 | |
| 176 | 176 | // Failed to get the token credentials or user details. |
| 177 | 177 | Craft::$app->getSession()->setError($exception->getMessage()); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | public function getEmbedHtml($videoId, array $options = []): string |
| 227 | 227 | { |
| 228 | 228 | $embedAttributes = [ |
| 229 | - 'title' => 'External video from ' . $this->getHandle(), |
|
| 229 | + 'title' => 'External video from '.$this->getHandle(), |
|
| 230 | 230 | 'frameborder' => '0', |
| 231 | 231 | 'allowfullscreen' => 'true', |
| 232 | 232 | 'allowscriptaccess' => 'true', |
@@ -253,10 +253,10 @@ discard block |
||
| 253 | 253 | $embedAttributesString = ''; |
| 254 | 254 | |
| 255 | 255 | foreach ($embedAttributes as $key => $value) { |
| 256 | - $embedAttributesString .= ' ' . $key . '="' . $value . '"'; |
|
| 256 | + $embedAttributesString .= ' '.$key.'="'.$value.'"'; |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - return '<iframe src="' . $embedUrl . '"' . $embedAttributesString . '></iframe>'; |
|
| 259 | + return '<iframe src="'.$embedUrl.'"'.$embedAttributesString.'></iframe>'; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | $options = http_build_query($options); |
| 282 | 282 | |
| 283 | - $format .= $queryMark . $options; |
|
| 283 | + $format .= $queryMark.$options; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | return sprintf($format, $videoId); |
@@ -357,13 +357,13 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public function getVideos($method, $options) |
| 359 | 359 | { |
| 360 | - $realMethod = 'getVideos' . ucwords($method); |
|
| 360 | + $realMethod = 'getVideos'.ucwords($method); |
|
| 361 | 361 | |
| 362 | 362 | if (method_exists($this, $realMethod)) { |
| 363 | 363 | return $this->{$realMethod}($options); |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | - throw new GatewayMethodNotFoundException('Gateway method “' . $realMethod . '” not found.'); |
|
| 366 | + throw new GatewayMethodNotFoundException('Gateway method “'.$realMethod.'” not found.'); |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | /** |
@@ -424,11 +424,11 @@ discard block |
||
| 424 | 424 | Craft::info('Vimeo X-RateLimit-Remaining: '.Json::encode($response->getHeader('X-RateLimit-Remaining')), __METHOD__); |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | - $body = (string)$response->getBody(); |
|
| 427 | + $body = (string) $response->getBody(); |
|
| 428 | 428 | $data = Json::decode($body); |
| 429 | 429 | } catch (BadResponseException $badResponseException) { |
| 430 | 430 | $response = $badResponseException->getResponse(); |
| 431 | - $body = (string)$response->getBody(); |
|
| 431 | + $body = (string) $response->getBody(); |
|
| 432 | 432 | |
| 433 | 433 | try { |
| 434 | 434 | $data = Json::decode($body); |
@@ -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 | |