@@ -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) |
@@ -326,10 +326,10 @@ discard block |
||
326 | 326 | $sizesWrapperId = Craft::$app->getView()->namespaceInputId('sizes-wrapper'); |
327 | 327 | $view = Craft::$app->getView(); |
328 | 328 | $view->registerJs( |
329 | - 'new Craft.OptimizedImagesInput(' . |
|
330 | - '"' . $namespacedId . '", ' . |
|
331 | - '"' . $namespacePrefix . '",' . |
|
332 | - '"' . $sizesWrapperId . '"' . |
|
329 | + 'new Craft.OptimizedImagesInput('. |
|
330 | + '"'.$namespacedId.'", '. |
|
331 | + '"'.$namespacePrefix.'",'. |
|
332 | + '"'.$sizesWrapperId.'"'. |
|
333 | 333 | ');' |
334 | 334 | ); |
335 | 335 | |
@@ -492,8 +492,8 @@ discard block |
||
492 | 492 | $jsonVars = Json::encode($jsonVars); |
493 | 493 | $view = Craft::$app->getView(); |
494 | 494 | $view->registerJs( |
495 | - "$('#{$nameSpaceId}-field').ImageOptimizeOptimizedImages(" . |
|
496 | - $jsonVars . |
|
495 | + "$('#{$nameSpaceId}-field').ImageOptimizeOptimizedImages(". |
|
496 | + $jsonVars. |
|
497 | 497 | ");" |
498 | 498 | ); |
499 | 499 |
@@ -261,12 +261,12 @@ |
||
261 | 261 | ?: GqlEntityRegistry::createEntity($typeName, new OptimizedImagesType([ |
262 | 262 | 'name' => $typeName, |
263 | 263 | 'description' => 'This entity has all the OptimizedImages properties', |
264 | - 'fields' => function () use ($optimizedImagesFields) { |
|
264 | + 'fields' => function() use ($optimizedImagesFields) { |
|
265 | 265 | return $optimizedImagesFields; |
266 | 266 | }, |
267 | 267 | ])); |
268 | 268 | |
269 | - TypeLoader::registerType($typeName, function () use ($optimizedImagesType) { |
|
269 | + TypeLoader::registerType($typeName, function() use ($optimizedImagesType) { |
|
270 | 270 | return $optimizedImagesType; |
271 | 271 | }); |
272 | 272 |