@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | Event::on( |
| 70 | 70 | CraftVariable::class, |
| 71 | 71 | CraftVariable::EVENT_INIT, |
| 72 | - function (Event $event) { |
|
| 72 | + function(Event $event) { |
|
| 73 | 73 | /** @var CraftVariable $variable */ |
| 74 | 74 | $variable = $event->sender; |
| 75 | 75 | $variable->set('youtubelive', YoutubeLiveEmbedVariable::class); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | Craft::t( |
| 81 | 81 | 'youtubeliveembed', |
| 82 | 82 | '{name} plugin loaded', |
| 83 | - ['name' => $this->name] |
|
| 83 | + [ 'name' => $this->name ] |
|
| 84 | 84 | ), |
| 85 | 85 | __METHOD__ |
| 86 | 86 | ); |
@@ -36,8 +36,8 @@ |
||
| 36 | 36 | public function rules() |
| 37 | 37 | { |
| 38 | 38 | return [ |
| 39 | - ['youtubeChannelId', 'string'], |
|
| 40 | - ['youtubeChannelId', 'default', 'value' => ''], |
|
| 39 | + [ 'youtubeChannelId', 'string' ], |
|
| 40 | + [ 'youtubeChannelId', 'default', 'value' => '' ], |
|
| 41 | 41 | ]; |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | // Static Methods |
| 26 | 26 | // ========================================================================= |
| 27 | 27 | |
| 28 | - public static function renderStringTemplate(string $templateString, array $params = []): string |
|
| 28 | + public static function renderStringTemplate(string $templateString, array $params = [ ]): string |
|
| 29 | 29 | { |
| 30 | 30 | try { |
| 31 | 31 | $html = Craft::$app->getView()->renderString($templateString, $params); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $html = Craft::t( |
| 34 | 34 | 'youtubeliveembed', |
| 35 | 35 | 'Error rendering template string -> {error}', |
| 36 | - ['error' => $e->getMessage()] |
|
| 36 | + [ 'error' => $e->getMessage() ] |
|
| 37 | 37 | ); |
| 38 | 38 | Craft::error($html, __METHOD__); |
| 39 | 39 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @return \Twig_Markup |
| 51 | 51 | */ |
| 52 | - public static function renderPluginTemplate(string $templatePath, array $params = []): \Twig_Markup |
|
| 52 | + public static function renderPluginTemplate(string $templatePath, array $params = [ ]): \Twig_Markup |
|
| 53 | 53 | { |
| 54 | 54 | // Stash the old template mode, and set it Control Panel template mode |
| 55 | 55 | $oldMode = Craft::$app->view->getTemplateMode(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $htmlText = Craft::t( |
| 68 | 68 | 'youtubeliveembed', |
| 69 | 69 | 'Error rendering `{template}` -> {error}', |
| 70 | - ['template' => $templatePath, 'error' => $e->getMessage()] |
|
| 70 | + [ 'template' => $templatePath, 'error' => $e->getMessage() ] |
|
| 71 | 71 | ); |
| 72 | 72 | Craft::error($htmlText, __METHOD__); |
| 73 | 73 | $templateRendered = false; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $htmlText = Craft::t( |
| 89 | 89 | 'youtubeliveembed', |
| 90 | 90 | 'Error rendering `{template}` -> {error}', |
| 91 | - ['template' => $templatePath, 'error' => $e->getMessage()] |
|
| 91 | + [ 'template' => $templatePath, 'error' => $e->getMessage() ] |
|
| 92 | 92 | ); |
| 93 | 93 | Craft::error($htmlText, __METHOD__); |
| 94 | 94 | $templateRendered = false; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | protected function getYoutubeStreamUrl(): string |
| 174 | 174 | { |
| 175 | - $url = UrlHelper::urlWithParams(self::YOUTUBE_STREAM_URL, [ |
|
| 175 | + $url = UrlHelper::urlWithParams(self::YOUTUBE_STREAM_URL, [ |
|
| 176 | 176 | 'channel' => YoutubeLiveEmbed::$youtubeChannelId, |
| 177 | 177 | ]); |
| 178 | 178 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | if ($data = @file_get_contents($liveUrl)) { |
| 214 | 214 | // Find the video ID in there |
| 215 | 215 | if (preg_match('/\'VIDEO_ID\': \"(.*?)\"/', $data, $matches)) { |
| 216 | - $videoId = $matches[1]; |
|
| 216 | + $videoId = $matches[ 1 ]; |
|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |