@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | && (strpos($summaryResult['videoFrameRate'], '/') !== false) |
449 | 449 | ) { |
450 | 450 | $parts = explode('/', $summaryResult['videoFrameRate']); |
451 | - $summaryResult['videoFrameRate'] = (float)$parts[0] / (float)$parts[1]; |
|
451 | + $summaryResult['videoFrameRate'] = (float) $parts[0] / (float) $parts[1]; |
|
452 | 452 | } |
453 | 453 | $result = $summaryResult; |
454 | 454 | } |
@@ -701,14 +701,14 @@ discard block |
||
701 | 701 | // If it's local, get a path to the file |
702 | 702 | if ($assetVolume instanceof Local) { |
703 | 703 | $sourcePath = rtrim($assetVolume->path, DIRECTORY_SEPARATOR); |
704 | - $sourcePath .= '' === $sourcePath ? '': DIRECTORY_SEPARATOR; |
|
704 | + $sourcePath .= '' === $sourcePath ? '' : DIRECTORY_SEPARATOR; |
|
705 | 705 | $folderPath = ''; |
706 | 706 | try { |
707 | 707 | $folderPath = rtrim($asset->getFolder()->path, DIRECTORY_SEPARATOR); |
708 | 708 | } catch (InvalidConfigException $e) { |
709 | 709 | Craft::error($e->getMessage(), __METHOD__); |
710 | 710 | } |
711 | - $folderPath .= '' === $folderPath ? '': DIRECTORY_SEPARATOR; |
|
711 | + $folderPath .= '' === $folderPath ? '' : DIRECTORY_SEPARATOR; |
|
712 | 712 | |
713 | 713 | $filePath = $sourcePath.$folderPath.$asset->filename; |
714 | 714 | } else { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | Event::on( |
129 | 129 | CraftVariable::class, |
130 | 130 | CraftVariable::EVENT_INIT, |
131 | - function (Event $event) { |
|
131 | + function(Event $event) { |
|
132 | 132 | /** @var CraftVariable $variable */ |
133 | 133 | $variable = $event->sender; |
134 | 134 | $variable->set('transcoder', TranscoderVariable::class); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | Event::on( |
146 | 146 | Assets::class, |
147 | 147 | Assets::EVENT_GET_THUMB_PATH, |
148 | - function (AssetThumbEvent $event) { |
|
148 | + function(AssetThumbEvent $event) { |
|
149 | 149 | Craft::debug( |
150 | 150 | 'Assets::EVENT_GET_THUMB_PATH', |
151 | 151 | __METHOD__ |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | Event::on( |
162 | 162 | ClearCaches::class, |
163 | 163 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
164 | - function (RegisterCacheOptionsEvent $event) { |
|
164 | + function(RegisterCacheOptionsEvent $event) { |
|
165 | 165 | $event->options[] = [ |
166 | 166 | 'key' => 'transcoder', |
167 | 167 | 'label' => Craft::t('transcoder', 'Transcoder caches'), |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | Event::on( |
174 | 174 | Plugins::class, |
175 | 175 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
176 | - function (PluginEvent $event) { |
|
176 | + function(PluginEvent $event) { |
|
177 | 177 | if ($event->plugin === $this) { |
178 | 178 | $request = Craft::$app->getRequest(); |
179 | 179 | if ($request->isCpRequest) { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | Event::on( |
199 | 199 | UrlManager::class, |
200 | 200 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
201 | - function (RegisterUrlRulesEvent $event) { |
|
201 | + function(RegisterUrlRulesEvent $event) { |
|
202 | 202 | Craft::debug( |
203 | 203 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
204 | 204 | __METHOD__ |
@@ -155,7 +155,7 @@ |
||
155 | 155 | { |
156 | 156 | $result = ''; |
157 | 157 | $filePath = parse_url($url, PHP_URL_PATH); |
158 | - $filePath = $_SERVER['DOCUMENT_ROOT'] . $filePath; |
|
158 | + $filePath = $_SERVER['DOCUMENT_ROOT'].$filePath; |
|
159 | 159 | if (file_exists($filePath)) { |
160 | 160 | $urlParams = [ |
161 | 161 | 'url' => $url, |
@@ -84,12 +84,12 @@ discard block |
||
84 | 84 | |
85 | 85 | // rawDuration is in 00:00:00.00 format. This converts it to seconds. |
86 | 86 | $ar = array_reverse(explode(':', $rawDuration)); |
87 | - $duration = (float)$ar[0]; |
|
87 | + $duration = (float) $ar[0]; |
|
88 | 88 | if (!empty($ar[1])) { |
89 | - $duration += (int)$ar[1] * 60; |
|
89 | + $duration += (int) $ar[1] * 60; |
|
90 | 90 | } |
91 | 91 | if (!empty($ar[2])) { |
92 | - $duration += (int)$ar[2] * 60 * 60; |
|
92 | + $duration += (int) $ar[2] * 60 * 60; |
|
93 | 93 | } |
94 | 94 | } else { |
95 | 95 | $duration = 'unknown'; // with GIF as input, duration is unknown |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | |
107 | 107 | //rawTime is in 00:00:00.00 format. This converts it to seconds. |
108 | 108 | $ar = array_reverse(explode(':', $rawTime)); |
109 | - $time = (float)$ar[0]; |
|
109 | + $time = (float) $ar[0]; |
|
110 | 110 | if (!empty($ar[1])) { |
111 | - $time += (int)$ar[1] * 60; |
|
111 | + $time += (int) $ar[1] * 60; |
|
112 | 112 | } |
113 | 113 | if (!empty($ar[2])) { |
114 | - $time += (int)$ar[2] * 60 * 60; |
|
114 | + $time += (int) $ar[2] * 60 * 60; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | //calculate the progress |