Passed
Push — develop ( ca687a...aa38a4 )
by Andrew
04:47
created
src/services/OptimizedImages.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/helpers/PluginTemplate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/services/Optimize.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -261,7 +261,7 @@
 block discarded – undo
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
                 ],
Please login to merge, or discard this patch.
src/models/OptimizedImage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      */
434 434
     public function getPlaceholderImage(): string
435 435
     {
436
-        return (string)$this->placeholderImage();
436
+        return (string) $this->placeholderImage();
437 437
     }
438 438
 
439 439
     /**
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
      */
471 471
     public function getPlaceholderBox(string $color = null): string
472 472
     {
473
-        return (string)$this->placeholderBox($color);
473
+        return (string) $this->placeholderBox($color);
474 474
     }
475 475
 
476 476
     /**
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
      */
512 512
     public function getPlaceholderSilhouette(): string
513 513
     {
514
-        return (string)$this->placeholderSilhouette();
514
+        return (string) $this->placeholderSilhouette();
515 515
     }
516 516
 
517 517
     /**
@@ -623,10 +623,10 @@  discard block
 block discarded – undo
623 623
         foreach ($array as $key => $value) {
624 624
             if ($dpr) {
625 625
                 $descriptor = '1x';
626
-                if (!empty($array[(int)$key / 2])) {
626
+                if (!empty($array[(int) $key / 2])) {
627 627
                     $descriptor = '2x';
628 628
                 }
629
-                if (!empty($array[(int)$key / 3])) {
629
+                if (!empty($array[(int) $key / 3])) {
630 630
                     $descriptor = '3x';
631 631
                 }
632 632
             } else {
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
     protected function swapLazyLoadAttrs(string $lazyLoad, array $attrs): array
664 664
     {
665 665
         if (isset($attrs['class'])) {
666
-            $attrs['class'] = trim($attrs['class'] . ' lazyload');
666
+            $attrs['class'] = trim($attrs['class'].' lazyload');
667 667
         }
668 668
         if (!empty($attrs['loading'])) {
669 669
             $attrs['loading'] = 'lazy';
Please login to merge, or discard this patch.