@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $index->fileExists = 0; |
| 112 | 112 | $transforms->storeTransformIndexData($index); |
| 113 | 113 | $volume = $asset->getVolume(); |
| 114 | - $transformPath = $asset->folderPath . $transforms->getTransformSubpath($asset, $index); |
|
| 114 | + $transformPath = $asset->folderPath.$transforms->getTransformSubpath($asset, $index); |
|
| 115 | 115 | try { |
| 116 | 116 | $volume->deleteFile($transformPath); |
| 117 | 117 | } catch (\Throwable $exception) { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $msg = 'Failed to update transform: '.$e->getMessage(); |
| 121 | 121 | Craft::error($msg, __METHOD__); |
| 122 | 122 | if (Craft::$app instanceof ConsoleApplication) { |
| 123 | - echo $msg . PHP_EOL; |
|
| 123 | + echo $msg.PHP_EOL; |
|
| 124 | 124 | } |
| 125 | 125 | // Add the error message to the stickyErrors for the model |
| 126 | 126 | $model->stickyErrors[] = $msg; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | __METHOD__ |
| 144 | 144 | ); |
| 145 | 145 | if (Craft::$app instanceof ConsoleApplication) { |
| 146 | - echo $msg . PHP_EOL; |
|
| 146 | + echo $msg.PHP_EOL; |
|
| 147 | 147 | } |
| 148 | 148 | // Add the error message to the stickyErrors for the model |
| 149 | 149 | $model->stickyErrors[] = $msg; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $folder = $asset->getFolder(); |
| 210 | 210 | while ($folder !== null && !$createVariants) { |
| 211 | 211 | if ($folder->uid === $subfolder) { |
| 212 | - Craft::info('Matched subfolder uid: ' . print_r($subfolder, true), __METHOD__); |
|
| 212 | + Craft::info('Matched subfolder uid: '.print_r($subfolder, true), __METHOD__); |
|
| 213 | 213 | $createVariants = true; |
| 214 | 214 | } else { |
| 215 | 215 | $folder = $folder->getParent(); |
@@ -491,20 +491,20 @@ discard block |
||
| 491 | 491 | } |
| 492 | 492 | $useAspectRatio = $variant['useAspectRatio'] ?? false; |
| 493 | 493 | if ($useAspectRatio) { |
| 494 | - $aspectRatio = (int)$variant['aspectRatioX'] / (int)$variant['aspectRatioY']; |
|
| 494 | + $aspectRatio = (int) $variant['aspectRatioX'] / (int) $variant['aspectRatioY']; |
|
| 495 | 495 | } else { |
| 496 | - $aspectRatio = (int)$asset->width / (int)$asset->height; |
|
| 496 | + $aspectRatio = (int) $asset->width / (int) $asset->height; |
|
| 497 | 497 | } |
| 498 | - $width = (int)$variant['width'] * (int)$retinaSize; |
|
| 498 | + $width = (int) $variant['width'] * (int) $retinaSize; |
|
| 499 | 499 | $transform->width = $width; |
| 500 | - $transform->height = (int)($width / $aspectRatio); |
|
| 500 | + $transform->height = (int) ($width / $aspectRatio); |
|
| 501 | 501 | // Image quality |
| 502 | - $quality = (int)($variant['quality'] ?? null); |
|
| 502 | + $quality = (int) ($variant['quality'] ?? null); |
|
| 503 | 503 | if (empty($quality)) { |
| 504 | 504 | $quality = null; |
| 505 | 505 | } |
| 506 | 506 | if ($quality !== null && $settings->lowerQualityRetinaImageVariants && $retinaSize != '1') { |
| 507 | - $quality = (int)($quality * (1.5 / (int)$retinaSize)); |
|
| 507 | + $quality = (int) ($quality * (1.5 / (int) $retinaSize)); |
|
| 508 | 508 | } |
| 509 | 509 | $transform->quality = $quality; |
| 510 | 510 | // Interlaced (progressive JPEGs or interlaced PNGs) |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | array $params = [], |
| 64 | 64 | string $minifier = null |
| 65 | 65 | ): string { |
| 66 | - $template = 'image-optimize/' . $templatePath; |
|
| 66 | + $template = 'image-optimize/'.$templatePath; |
|
| 67 | 67 | $oldMode = Craft::$app->view->getTemplateMode(); |
| 68 | 68 | // Look for the template on the frontend first |
| 69 | 69 | try { |
@@ -261,7 +261,7 @@ |
||
| 261 | 261 | $vars, |
| 262 | 262 | $minifier |
| 263 | 263 | ); |
| 264 | - $content = (string)$content; |
|
| 264 | + $content = (string) $content; |
|
| 265 | 265 | if ($scriptAttrs !== null) { |
| 266 | 266 | $attrs = array_merge([ |
| 267 | 267 | ], |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | */ |
| 521 | 521 | public function getPlaceholderImage(): string |
| 522 | 522 | { |
| 523 | - return (string)$this->placeholderImage(); |
|
| 523 | + return (string) $this->placeholderImage(); |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | /** |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | */ |
| 558 | 558 | public function getPlaceholderBox(string $color = null): string |
| 559 | 559 | { |
| 560 | - return (string)$this->placeholderBox($color); |
|
| 560 | + return (string) $this->placeholderBox($color); |
|
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | /** |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | */ |
| 599 | 599 | public function getPlaceholderSilhouette(): string |
| 600 | 600 | { |
| 601 | - return (string)$this->placeholderSilhouette(); |
|
| 601 | + return (string) $this->placeholderSilhouette(); |
|
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | /** |
@@ -710,10 +710,10 @@ discard block |
||
| 710 | 710 | foreach ($array as $key => $value) { |
| 711 | 711 | if ($dpr) { |
| 712 | 712 | $descriptor = '1x'; |
| 713 | - if (!empty($array[(int)$key / 2])) { |
|
| 713 | + if (!empty($array[(int) $key / 2])) { |
|
| 714 | 714 | $descriptor = '2x'; |
| 715 | 715 | } |
| 716 | - if (!empty($array[(int)$key / 3])) { |
|
| 716 | + if (!empty($array[(int) $key / 3])) { |
|
| 717 | 717 | $descriptor = '3x'; |
| 718 | 718 | } |
| 719 | 719 | } else { |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | protected function swapLazyLoadAttrs(string $lazyLoad, array $attrs): array |
| 751 | 751 | { |
| 752 | 752 | if (isset($attrs['class'])) { |
| 753 | - $attrs['class'] = trim($attrs['class'] . ' lazyload'); |
|
| 753 | + $attrs['class'] = trim($attrs['class'].' lazyload'); |
|
| 754 | 754 | } |
| 755 | 755 | if (!empty($attrs['loading'])) { |
| 756 | 756 | $attrs['loading'] = 'lazy'; |
@@ -764,8 +764,8 @@ discard block |
||
| 764 | 764 | $attrs['src'] = $this->getLazyLoadSrc($lazyLoad); |
| 765 | 765 | if (isset($attrs['style'])) { |
| 766 | 766 | $attrs['style'] = trim( |
| 767 | - $attrs['style'] . |
|
| 768 | - 'background-image:url(' . $this->getLazyLoadSrc($lazyLoad) . '); background-size: cover;' |
|
| 767 | + $attrs['style']. |
|
| 768 | + 'background-image:url('.$this->getLazyLoadSrc($lazyLoad).'); background-size: cover;' |
|
| 769 | 769 | ); |
| 770 | 770 | } |
| 771 | 771 | } |