Passed
Pull Request — v1 (#20)
by
unknown
04:43
created
src/services/Transcode.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$subfolder = '';
101 101
 
102 102
 		// sub folder check
103
-		if(\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
103
+		if (\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
104 104
 			$subfolder = $filePath->folderPath;
105 105
 		}
106 106
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		$subfolder = '';
242 242
 
243 243
 		// sub folder check
244
-		if(\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
244
+		if (\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
245 245
 			$subfolder = $filePath->folderPath;
246 246
 		}
247 247
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             if ($asPath) {
314 314
                 $result = $destThumbnailPath;
315 315
             } else {
316
-                $url = $settings['transcoderUrls']['thumbnail'] . $subfolder ?? $settings['transcoderUrls']['default'];
316
+                $url = $settings['transcoderUrls']['thumbnail'].$subfolder ?? $settings['transcoderUrls']['default'];
317 317
                 $result = Craft::getAlias($url).$destThumbnailFile;
318 318
             }
319 319
         }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		$subfolder = '';
338 338
 
339 339
 		// sub folder check
340
-		if(\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
340
+		if (\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
341 341
 			$subfolder = $filePath->folderPath;
342 342
 		}
343 343
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 
414 414
             // If the audio file already exists and hasn't been modified, return it.  Otherwise, start it transcoding
415 415
             if ($this->shouldGenerateAsset('audio', $destAudioPath, $filePath)) {
416
-                $url = $settings['transcoderUrls']['audio'] . $subfolder ?? $settings['transcoderUrls']['default'];
416
+                $url = $settings['transcoderUrls']['audio'].$subfolder ?? $settings['transcoderUrls']['default'];
417 417
                 $result = Craft::getAlias($url).$destAudioFile;
418 418
             } else {
419 419
                 // Kick off the transcoding
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                     && (strpos($summaryResult['videoFrameRate'], '/') !== false)
495 495
                 ) {
496 496
                     $parts = explode('/', $summaryResult['videoFrameRate']);
497
-                    $summaryResult['videoFrameRate'] = (float)$parts[0] / (float)$parts[1];
497
+                    $summaryResult['videoFrameRate'] = (float) $parts[0] / (float) $parts[1];
498 498
                 }
499 499
                 $result = $summaryResult;
500 500
             }
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 		$subfolder = '';
607 607
 
608 608
 		// sub folder check
609
-		if(\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
609
+		if (\is_object($filePath) && ($filePath instanceof Asset) && $settings['createSubfolders']) {
610 610
 			$subfolder = $filePath->folderPath;
611 611
 		}
612 612
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 
668 668
             // If the video file already exists and hasn't been modified, return it.  Otherwise, start it transcoding
669 669
             if ($this->shouldGenerateAsset('gif', $destVideoPath, $filePath)) {
670
-                $url = $settings['transcoderUrls']['gif'] . $subfolder ?? $settings['transcoderUrls']['default'];
670
+                $url = $settings['transcoderUrls']['gif'].$subfolder ?? $settings['transcoderUrls']['default'];
671 671
                 $result = Craft::getAlias($url).$destVideoFile;
672 672
             } else {
673 673
                 // Kick off the transcoding
@@ -757,14 +757,14 @@  discard block
 block discarded – undo
757 757
                 // If it's local, get a path to the file
758 758
                 if ($assetVolume instanceof Local) {
759 759
                     $sourcePath = rtrim($assetVolume->path, DIRECTORY_SEPARATOR);
760
-                    $sourcePath .= '' === $sourcePath ? '': DIRECTORY_SEPARATOR;
760
+                    $sourcePath .= '' === $sourcePath ? '' : DIRECTORY_SEPARATOR;
761 761
                     $folderPath = '';
762 762
                     try {
763 763
                         $folderPath = rtrim($asset->getFolder()->path, DIRECTORY_SEPARATOR);
764 764
                     } catch (InvalidConfigException $e) {
765 765
                         Craft::error($e->getMessage(), __METHOD__);
766 766
                     }
767
-                    $folderPath .= '' === $folderPath ? '': DIRECTORY_SEPARATOR;
767
+                    $folderPath .= '' === $folderPath ? '' : DIRECTORY_SEPARATOR;
768 768
 
769 769
                     $filePath = $sourcePath.$folderPath.$asset->filename;
770 770
                 } else {
Please login to merge, or discard this patch.