@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $vars, |
| 278 | 278 | $minifier |
| 279 | 279 | ); |
| 280 | - $content = (string)$content; |
|
| 280 | + $content = (string) $content; |
|
| 281 | 281 | if ($scriptAttrs !== null) { |
| 282 | 282 | $attrs = array_merge([ |
| 283 | 283 | ], |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $vars, |
| 313 | 313 | $minifier |
| 314 | 314 | ); |
| 315 | - $content = (string)$content; |
|
| 315 | + $content = (string) $content; |
|
| 316 | 316 | if ($scriptAttrs !== null) { |
| 317 | 317 | $attrs = array_merge([ |
| 318 | 318 | ], |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | .'%'; |
| 377 | 377 | Craft::info($message, __METHOD__); |
| 378 | 378 | if (Craft::$app instanceof ConsoleApplication) { |
| 379 | - echo $message . PHP_EOL; |
|
| 379 | + echo $message.PHP_EOL; |
|
| 380 | 380 | } |
| 381 | 381 | // Create any image variants |
| 382 | 382 | $this->createImageVariants( |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | .'%'; |
| 532 | 532 | Craft::info($message, __METHOD__); |
| 533 | 533 | if (Craft::$app instanceof ConsoleApplication) { |
| 534 | - echo $message . PHP_EOL; |
|
| 534 | + echo $message.PHP_EOL; |
|
| 535 | 535 | } |
| 536 | 536 | // Copy the image variant into place |
| 537 | 537 | $this->copyImageVariantToVolume( |
@@ -630,9 +630,9 @@ discard block |
||
| 630 | 630 | // Handle auto-sharpening scaled down images |
| 631 | 631 | if ($settings->autoSharpenScaledImages) { |
| 632 | 632 | // See if the image has been scaled >= 50% |
| 633 | - $widthScale = (int)(($image->getWidth() / $asset->getWidth()) * 100); |
|
| 634 | - $heightScale = (int)(($image->getHeight() / $asset->getHeight()) * 100); |
|
| 635 | - if (($widthScale >= (int)$settings->sharpenScaledImagePercentage) || ($heightScale >= (int)$settings->sharpenScaledImagePercentage)) { |
|
| 633 | + $widthScale = (int) (($image->getWidth() / $asset->getWidth()) * 100); |
|
| 634 | + $heightScale = (int) (($image->getHeight() / $asset->getHeight()) * 100); |
|
| 635 | + if (($widthScale >= (int) $settings->sharpenScaledImagePercentage) || ($heightScale >= (int) $settings->sharpenScaledImagePercentage)) { |
|
| 636 | 636 | $imagineImage->effects() |
| 637 | 637 | ->sharpen(); |
| 638 | 638 | Craft::debug( |
@@ -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; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | __METHOD__ |
| 145 | 145 | ); |
| 146 | 146 | if (Craft::$app instanceof ConsoleApplication) { |
| 147 | - echo $msg . PHP_EOL; |
|
| 147 | + echo $msg.PHP_EOL; |
|
| 148 | 148 | } |
| 149 | 149 | if ($canManipulate) { |
| 150 | 150 | // Add the error message to the stickyErrors for the model |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $folder = $asset->getFolder(); |
| 216 | 216 | while ($folder !== null && !$createVariants) { |
| 217 | 217 | if ($folder->uid === $subfolder || $folder->name === $subfolder) { |
| 218 | - Craft::info('Matched subfolder uid: ' . print_r($subfolder, true), __METHOD__); |
|
| 218 | + Craft::info('Matched subfolder uid: '.print_r($subfolder, true), __METHOD__); |
|
| 219 | 219 | $createVariants = true; |
| 220 | 220 | } else { |
| 221 | 221 | $folder = $folder->getParent(); |
@@ -502,20 +502,20 @@ discard block |
||
| 502 | 502 | } |
| 503 | 503 | $useAspectRatio = $variant['useAspectRatio'] ?? false; |
| 504 | 504 | if ($useAspectRatio) { |
| 505 | - $aspectRatio = (float)$variant['aspectRatioX'] / (float)$variant['aspectRatioY']; |
|
| 505 | + $aspectRatio = (float) $variant['aspectRatioX'] / (float) $variant['aspectRatioY']; |
|
| 506 | 506 | } else { |
| 507 | - $aspectRatio = (float)$asset->width / (float)$asset->height; |
|
| 507 | + $aspectRatio = (float) $asset->width / (float) $asset->height; |
|
| 508 | 508 | } |
| 509 | - $width = (int)$variant['width'] * (int)$retinaSize; |
|
| 509 | + $width = (int) $variant['width'] * (int) $retinaSize; |
|
| 510 | 510 | $transform->width = $width; |
| 511 | - $transform->height = (int)($width / $aspectRatio); |
|
| 511 | + $transform->height = (int) ($width / $aspectRatio); |
|
| 512 | 512 | // Image quality |
| 513 | - $quality = (int)($variant['quality'] ?? null); |
|
| 513 | + $quality = (int) ($variant['quality'] ?? null); |
|
| 514 | 514 | if (empty($quality)) { |
| 515 | 515 | $quality = null; |
| 516 | 516 | } |
| 517 | 517 | if ($quality !== null && $settings->lowerQualityRetinaImageVariants && $retinaSize != '1') { |
| 518 | - $quality = (int)($quality * (1.5 / (int)$retinaSize)); |
|
| 518 | + $quality = (int) ($quality * (1.5 / (int) $retinaSize)); |
|
| 519 | 519 | } |
| 520 | 520 | $transform->quality = $quality; |
| 521 | 521 | // Interlaced (progressive JPEGs or interlaced PNGs) |