@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | Craft::beginProfile('generatePlaceholderImage', __METHOD__); |
85 | 85 | $result = ''; |
86 | 86 | $width = self::PLACEHOLDER_WIDTH; |
87 | - $height = (int)($width / $aspectRatio); |
|
87 | + $height = (int) ($width / $aspectRatio); |
|
88 | 88 | $placeholderPath = $this->createImageFromPath($tempPath, $width, $height, self::PLACEHOLDER_QUALITY, $position); |
89 | 89 | if (!empty($placeholderPath)) { |
90 | 90 | $result = base64_encode(file_get_contents($placeholderPath)); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $lightness /= $colorCount; |
149 | 149 | } |
150 | 150 | |
151 | - return $lightness === null ? $lightness : (int)$lightness; |
|
151 | + return $lightness === null ? $lightness : (int) $lightness; |
|
152 | 152 | } |
153 | 153 | /** |
154 | 154 | * Generate an SVG image via Potrace |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | { |
208 | 208 | Craft::beginProfile('createTempPlaceholderImage', __METHOD__); |
209 | 209 | $width = self::TEMP_PLACEHOLDER_WIDTH; |
210 | - $height = (int)($width / $aspectRatio); |
|
210 | + $height = (int) ($width / $aspectRatio); |
|
211 | 211 | $tempPath = $this->createImageFromAsset($asset, $width, $height, self::TEMP_PLACEHOLDER_QUALITY, $position); |
212 | 212 | Craft::endProfile('createTempPlaceholderImage', __METHOD__); |
213 | 213 |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public static function RGBToHSL(array $rgb): array |
60 | 60 | { |
61 | - $r = ((float)$rgb['r']) / 255.0; |
|
62 | - $g = ((float)$rgb['g']) / 255.0; |
|
63 | - $b = ((float)$rgb['b']) / 255.0; |
|
61 | + $r = ((float) $rgb['r']) / 255.0; |
|
62 | + $g = ((float) $rgb['g']) / 255.0; |
|
63 | + $b = ((float) $rgb['b']) / 255.0; |
|
64 | 64 | |
65 | 65 | $maxC = max($r, $g, $b); |
66 | 66 | $minC = min($r, $g, $b); |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | $h /= 6.0; |
89 | 89 | } |
90 | 90 | |
91 | - $h = (int)round(360.0 * $h); |
|
92 | - $s = (int)round(100.0 * $s); |
|
93 | - $l = (int)round(100.0 * $l); |
|
91 | + $h = (int) round(360.0 * $h); |
|
92 | + $s = (int) round(100.0 * $s); |
|
93 | + $l = (int) round(100.0 * $l); |
|
94 | 94 | |
95 | 95 | return ['h' => $h, 's' => $s, 'l' => $l]; |
96 | 96 | } |