| @@ -90,9 +90,9 @@ discard block | ||
| 90 | 90 |                      if ($field instanceof OptimizedImagesField && $element instanceof Asset) { | 
| 91 | 91 |                          if ($this->fieldId === null || $field->id == $this->fieldId) { | 
| 92 | 92 |                              if (Craft::$app instanceof ConsoleApplication) { | 
| 93 | - echo $currentElement . '/' . $totalElements | |
| 94 | - . ' - processing asset: ' . $element->title | |
| 95 | - . ' from field: ' . $field->name . PHP_EOL; | |
| 93 | + echo $currentElement.'/'.$totalElements | |
| 94 | + . ' - processing asset: '.$element->title | |
| 95 | + . ' from field: '.$field->name.PHP_EOL; | |
| 96 | 96 | } | 
| 97 | 97 |                              try { | 
| 98 | 98 | ImageOptimize::$plugin->optimizedImages->updateOptimizedImageFieldData($field, $element, $this->force); | 
| @@ -102,9 +102,9 @@ discard block | ||
| 102 | 102 | echo '[error]: ' | 
| 103 | 103 | . $e->getMessage() | 
| 104 | 104 | . ' while processing ' | 
| 105 | - . $currentElement . '/' . $totalElements | |
| 106 | - . ' - processing asset: ' . $element->title | |
| 107 | - . ' from field: ' . $field->name . PHP_EOL; | |
| 105 | + . $currentElement.'/'.$totalElements | |
| 106 | + . ' - processing asset: '.$element->title | |
| 107 | + . ' from field: '.$field->name.PHP_EOL; | |
| 108 | 108 | } | 
| 109 | 109 | } | 
| 110 | 110 | } | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 | $index->fileExists = 0; | 
| 111 | 111 | $transforms->storeTransformIndexData($index); | 
| 112 | 112 | $volume = $asset->getVolume(); | 
| 113 | - $transformPath = $asset->folderPath . $transforms->getTransformSubpath($asset, $index); | |
| 113 | + $transformPath = $asset->folderPath.$transforms->getTransformSubpath($asset, $index); | |
| 114 | 114 |                              try { | 
| 115 | 115 | $volume->deleteFile($transformPath); | 
| 116 | 116 |                              } catch (\Throwable $exception) { | 
| @@ -119,7 +119,7 @@ discard block | ||
| 119 | 119 | $msg = 'Failed to update transform: '.$e->getMessage(); | 
| 120 | 120 | Craft::error($msg, __METHOD__); | 
| 121 | 121 |                              if (Craft::$app instanceof ConsoleApplication) { | 
| 122 | - echo $msg . PHP_EOL; | |
| 122 | + echo $msg.PHP_EOL; | |
| 123 | 123 | } | 
| 124 | 124 | } | 
| 125 | 125 | } | 
| @@ -140,7 +140,7 @@ discard block | ||
| 140 | 140 | __METHOD__ | 
| 141 | 141 | ); | 
| 142 | 142 |                      if (Craft::$app instanceof ConsoleApplication) { | 
| 143 | - echo $msg . PHP_EOL; | |
| 143 | + echo $msg.PHP_EOL; | |
| 144 | 144 | } | 
| 145 | 145 | } | 
| 146 | 146 | } | 
| @@ -200,7 +200,7 @@ discard block | ||
| 200 | 200 | $folder = $asset->getFolder(); | 
| 201 | 201 |                                  while ($folder !== null && !$createVariants) { | 
| 202 | 202 |                                      if ($folder->uid === $subfolder) { | 
| 203 | -                                        Craft::info('Matched subfolder uid: ' . print_r($subfolder, true), __METHOD__); | |
| 203 | +                                        Craft::info('Matched subfolder uid: '.print_r($subfolder, true), __METHOD__); | |
| 204 | 204 | $createVariants = true; | 
| 205 | 205 |                                      } else { | 
| 206 | 206 | $folder = $folder->getParent(); | 
| @@ -478,20 +478,20 @@ discard block | ||
| 478 | 478 | } | 
| 479 | 479 | $useAspectRatio = $variant['useAspectRatio'] ?? false; | 
| 480 | 480 |          if ($useAspectRatio) { | 
| 481 | - $aspectRatio = (int)$variant['aspectRatioX'] / (int)$variant['aspectRatioY']; | |
| 481 | + $aspectRatio = (int) $variant['aspectRatioX'] / (int) $variant['aspectRatioY']; | |
| 482 | 482 |          } else { | 
| 483 | - $aspectRatio = (int)$asset->width / (int)$asset->height; | |
| 483 | + $aspectRatio = (int) $asset->width / (int) $asset->height; | |
| 484 | 484 | } | 
| 485 | - $width = (int)$variant['width'] * (int)$retinaSize; | |
| 485 | + $width = (int) $variant['width'] * (int) $retinaSize; | |
| 486 | 486 | $transform->width = $width; | 
| 487 | - $transform->height = (int)($width / $aspectRatio); | |
| 487 | + $transform->height = (int) ($width / $aspectRatio); | |
| 488 | 488 | // Image quality | 
| 489 | - $quality = (int)($variant['quality'] ?? null); | |
| 489 | + $quality = (int) ($variant['quality'] ?? null); | |
| 490 | 490 |          if (empty($quality)) { | 
| 491 | 491 | $quality = null; | 
| 492 | 492 | } | 
| 493 | 493 |          if ($quality !== null && $settings->lowerQualityRetinaImageVariants && $retinaSize != '1') { | 
| 494 | - $quality = (int)($quality * (1.5 / (int)$retinaSize)); | |
| 494 | + $quality = (int) ($quality * (1.5 / (int) $retinaSize)); | |
| 495 | 495 | } | 
| 496 | 496 | $transform->quality = $quality; | 
| 497 | 497 | // Interlaced (progressive JPEGs or interlaced PNGs) |