@@ -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 |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | Event::on( |
| 132 | 132 | CraftVariable::class, |
| 133 | 133 | CraftVariable::EVENT_INIT, |
| 134 | - function (Event $event) { |
|
| 134 | + function(Event $event) { |
|
| 135 | 135 | /** @var CraftVariable $variable */ |
| 136 | 136 | $variable = $event->sender; |
| 137 | 137 | $variable->set('transcoder', TranscoderVariable::class); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | Event::on( |
| 150 | 150 | Assets::class, |
| 151 | 151 | Assets::EVENT_GET_THUMB_PATH, |
| 152 | - function (AssetThumbEvent $event) { |
|
| 152 | + function(AssetThumbEvent $event) { |
|
| 153 | 153 | Craft::debug( |
| 154 | 154 | 'Assets::EVENT_GET_THUMB_PATH', |
| 155 | 155 | __METHOD__ |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | Event::on( |
| 167 | 167 | ClearCaches::class, |
| 168 | 168 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
| 169 | - function (RegisterCacheOptionsEvent $event) { |
|
| 169 | + function(RegisterCacheOptionsEvent $event) { |
|
| 170 | 170 | $event->options[] = [ |
| 171 | 171 | 'key' => 'transcoder', |
| 172 | 172 | 'label' => Craft::t('transcoder', 'Transcoder caches'), |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | Event::on( |
| 180 | 180 | Plugins::class, |
| 181 | 181 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 182 | - function (PluginEvent $event) { |
|
| 182 | + function(PluginEvent $event) { |
|
| 183 | 183 | if ($event->plugin === $this) { |
| 184 | 184 | $request = Craft::$app->getRequest(); |
| 185 | 185 | if ($request->isCpRequest) { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | Event::on( |
| 205 | 205 | UrlManager::class, |
| 206 | 206 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
| 207 | - function (RegisterUrlRulesEvent $event) { |
|
| 207 | + function(RegisterUrlRulesEvent $event) { |
|
| 208 | 208 | Craft::debug( |
| 209 | 209 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
| 210 | 210 | __METHOD__ |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $cache = Craft::$app->getCache(); |
| 404 | 404 | $file = $cache->getOrSet( |
| 405 | 405 | self::CACHE_KEY.$path, |
| 406 | - function () use ($path, $callback) { |
|
| 406 | + function() use ($path, $callback) { |
|
| 407 | 407 | $result = null; |
| 408 | 408 | $contents = @file_get_contents($path); |
| 409 | 409 | if ($contents) { |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | protected static function combinePaths(string ...$paths): string |
| 434 | 434 | { |
| 435 | 435 | $last_key = \count($paths) - 1; |
| 436 | - array_walk($paths, function (&$val, $key) use ($last_key) { |
|
| 436 | + array_walk($paths, function(&$val, $key) use ($last_key) { |
|
| 437 | 437 | switch ($key) { |
| 438 | 438 | case 0: |
| 439 | 439 | $val = rtrim($val, '/ '); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | self::$config['server']['publicPath'] = $baseAssetsUrl; |
| 56 | 56 | $useDevServer = getenv('NYS_PLUGIN_DEVSERVER'); |
| 57 | 57 | if ($useDevServer !== false) { |
| 58 | - self::$config['useDevServer'] = (bool)$useDevServer; |
|
| 58 | + self::$config['useDevServer'] = (bool) $useDevServer; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | $synchronous = $audioOptions['synchronous']; |
| 406 | 406 | } |
| 407 | 407 | if (!$synchronous) { |
| 408 | - $ffmpegCmd .=' 1> '.$progressFile.' 2>&1 & echo $!'; |
|
| 408 | + $ffmpegCmd .= ' 1> '.$progressFile.' 2>&1 & echo $!'; |
|
| 409 | 409 | // Make sure there isn't a lockfile for this audio file already |
| 410 | 410 | $lockFile = sys_get_temp_dir().DIRECTORY_SEPARATOR.$destAudioFile.'.lock'; |
| 411 | 411 | $oldPid = @file_get_contents($lockFile); |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | |
| 431 | 431 | if ($synchronous) { |
| 432 | 432 | Craft::info($ffmpegCmd, __METHOD__); |
| 433 | - $url = $settings['transcoderUrls']['audio'] . $subfolder ?? $settings['transcoderUrls']['default']; |
|
| 433 | + $url = $settings['transcoderUrls']['audio'].$subfolder ?? $settings['transcoderUrls']['default']; |
|
| 434 | 434 | $result = Craft::parseEnv($url).$destAudioFile; |
| 435 | 435 | } else { |
| 436 | 436 | Craft::info($ffmpegCmd."\nffmpeg PID: ".$pid, __METHOD__); |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | && (strpos($summaryResult['videoFrameRate'], '/') !== false) |
| 509 | 509 | ) { |
| 510 | 510 | $parts = explode('/', $summaryResult['videoFrameRate']); |
| 511 | - $summaryResult['videoFrameRate'] = (float)$parts[0] / (float)$parts[1]; |
|
| 511 | + $summaryResult['videoFrameRate'] = (float) $parts[0] / (float) $parts[1]; |
|
| 512 | 512 | } |
| 513 | 513 | $result = $summaryResult; |
| 514 | 514 | } |