@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | $previewVersion = ''; |
| 137 | 137 | if ($file instanceof IVersionedPreviewFile) { |
| 138 | - $previewVersion = $file->getPreviewVersion() . '-'; |
|
| 138 | + $previewVersion = $file->getPreviewVersion().'-'; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // If imaginary is enabled, and we request a small thumbnail, |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | continue; |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - $path = $prefix . (string)$preview->width() . '-' . (string)$preview->height() . '-max.' . $ext; |
|
| 341 | + $path = $prefix.(string) $preview->width().'-'.(string) $preview->height().'-max.'.$ext; |
|
| 342 | 342 | try { |
| 343 | 343 | $file = $previewFolder->newFile($path); |
| 344 | 344 | if ($preview instanceof IStreamImage) { |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | private function getPreviewSize(ISimpleFile $file, string $prefix = '') { |
| 366 | 366 | $size = explode('-', substr($file->getName(), strlen($prefix))); |
| 367 | - return [(int)$size[0], (int)$size[1]]; |
|
| 367 | + return [(int) $size[0], (int) $size[1]]; |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
@@ -376,13 +376,13 @@ discard block |
||
| 376 | 376 | * @return string |
| 377 | 377 | */ |
| 378 | 378 | private function generatePath($width, $height, $crop, $mimeType, $prefix) { |
| 379 | - $path = $prefix . (string)$width . '-' . (string)$height; |
|
| 379 | + $path = $prefix.(string) $width.'-'.(string) $height; |
|
| 380 | 380 | if ($crop) { |
| 381 | 381 | $path .= '-crop'; |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | $ext = $this->getExtention($mimeType); |
| 385 | - $path .= '.' . $ext; |
|
| 385 | + $path .= '.'.$ext; |
|
| 386 | 386 | return $path; |
| 387 | 387 | } |
| 388 | 388 | |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | $height /= $ratio; |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - return [(int)round($width), (int)round($height)]; |
|
| 475 | + return [(int) round($width), (int) round($height)]; |
|
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | /** |
@@ -507,10 +507,10 @@ discard block |
||
| 507 | 507 | $scaleH = $maxHeight / $widthR; |
| 508 | 508 | $scaleW = $width; |
| 509 | 509 | } |
| 510 | - $preview = $preview->preciseResizeCopy((int)round($scaleW), (int)round($scaleH)); |
|
| 510 | + $preview = $preview->preciseResizeCopy((int) round($scaleW), (int) round($scaleH)); |
|
| 511 | 511 | } |
| 512 | - $cropX = (int)floor(abs($width - $preview->width()) * 0.5); |
|
| 513 | - $cropY = (int)floor(abs($height - $preview->height()) * 0.5); |
|
| 512 | + $cropX = (int) floor(abs($width - $preview->width()) * 0.5); |
|
| 513 | + $cropY = (int) floor(abs($height - $preview->height()) * 0.5); |
|
| 514 | 514 | $preview = $preview->cropCopy($cropX, $cropY, $width, $height); |
| 515 | 515 | } else { |
| 516 | 516 | $preview = $maxPreview->resizeCopy(max($width, $height)); |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | */ |
| 558 | 558 | private function getPreviewFolder(File $file) { |
| 559 | 559 | // Obtain file id outside of try catch block to prevent the creation of an existing folder |
| 560 | - $fileId = (string)$file->getId(); |
|
| 560 | + $fileId = (string) $file->getId(); |
|
| 561 | 561 | |
| 562 | 562 | try { |
| 563 | 563 | $folder = $this->appData->getFolder($fileId); |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | case 'image/gif': |
| 583 | 583 | return 'gif'; |
| 584 | 584 | default: |
| 585 | - throw new \InvalidArgumentException('Not a valid mimetype: "' . $mimeType . '"'); |
|
| 585 | + throw new \InvalidArgumentException('Not a valid mimetype: "'.$mimeType.'"'); |
|
| 586 | 586 | } |
| 587 | 587 | } |
| 588 | 588 | } |