Passed
Push — master ( f9b6da...06d453 )
by Mattia
04:24
created
app/Image/LayerValidator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
             ++$x;
64 64
         }
65 65
         // mean value for each color
66
-        $totalPixels = $side->getWidth() * $side->getHeight();
67
-        $meanRed = array_sum($allRed) / $totalPixels;
68
-        $meanGreen = array_sum($allGreen) / $totalPixels;
69
-        $meanBlue = array_sum($allBlue) / $totalPixels;
70
-        $this->meanAlpha = (int) round(array_sum($allAlpha) / $totalPixels);
66
+        $totalPixels = $side->getWidth()*$side->getHeight();
67
+        $meanRed = array_sum($allRed)/$totalPixels;
68
+        $meanGreen = array_sum($allGreen)/$totalPixels;
69
+        $meanBlue = array_sum($allBlue)/$totalPixels;
70
+        $this->meanAlpha = (int) round(array_sum($allAlpha)/$totalPixels);
71 71
         // Arrays deviation
72 72
         $devsRed = [];
73 73
         $devsGreen = [];
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
             ++$i;
81 81
         }
82 82
         // stddev for each color
83
-        $this->redStdDev = sqrt(array_sum($devsRed) / $totalPixels);
84
-        $this->greenStdDev = sqrt(array_sum($devsGreen) / $totalPixels);
85
-        $this->blueStdDev = sqrt(array_sum($devsBlue) / $totalPixels);
83
+        $this->redStdDev = sqrt(array_sum($devsRed)/$totalPixels);
84
+        $this->greenStdDev = sqrt(array_sum($devsGreen)/$totalPixels);
85
+        $this->blueStdDev = sqrt(array_sum($devsBlue)/$totalPixels);
86 86
     }
87 87
 
88 88
     /**
Please login to merge, or discard this patch.
app/Image/IsometricAvatar.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     /**
16 16
      * Cosine PI/6.
17 17
      */
18
-    private const COSINE_PI_6 = \M_SQRT3 / 2;
18
+    private const COSINE_PI_6 = \M_SQRT3/2;
19 19
 
20 20
     /**
21 21
      * Base size (all requests must be <=).
@@ -206,16 +206,16 @@  discard block
 block discarded – undo
206 206
         );
207 207
 
208 208
         // Head image
209
-        $doubleAvatarSize = self::HEAD_BASE_SIZE * 2;
210
-        $finalImageSize = $doubleAvatarSize + (self::HEAD_MARGIN * 2);
209
+        $doubleAvatarSize = self::HEAD_BASE_SIZE*2;
210
+        $finalImageSize = $doubleAvatarSize + (self::HEAD_MARGIN*2);
211 211
 
212 212
         $this->head = new \Imagick();
213 213
         $this->head->newImage($finalImageSize, $finalImageSize, $this->getImagickPixelTransparent());
214 214
 
215 215
         // This is weird, but it works
216
-        $faceX = ((int) round(($doubleAvatarSize / 2))) - 2 + self::HEAD_MARGIN;
217
-        $faceY = $rightY = ((int) round($doubleAvatarSize / 4)) - 1 + self::HEAD_MARGIN;
218
-        $topX = $rightX = ((int) round($doubleAvatarSize / 16)) + self::HEAD_MARGIN;
216
+        $faceX = ((int) round(($doubleAvatarSize/2))) - 2 + self::HEAD_MARGIN;
217
+        $faceY = $rightY = ((int) round($doubleAvatarSize/4)) - 1 + self::HEAD_MARGIN;
218
+        $topX = $rightX = ((int) round($doubleAvatarSize/16)) + self::HEAD_MARGIN;
219 219
         $topY = -1 + self::HEAD_MARGIN;
220 220
 
221 221
         // Add Face Section
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
      */
270 270
     private function getFrontPoints($size = self::HEAD_BASE_SIZE): array
271 271
     {
272
-        $cosine_result = round(self::COSINE_PI_6 * $size);
273
-        $half_size = round($size / 2);
272
+        $cosine_result = round(self::COSINE_PI_6*$size);
273
+        $half_size = round($size/2);
274 274
 
275 275
         return [
276 276
             0, 0, 0, 0,
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
      */
289 289
     private function getTopPoints($size = self::HEAD_BASE_SIZE): array
290 290
     {
291
-        $cosine_result = round(self::COSINE_PI_6 * $size);
292
-        $half_size = round($size / 2);
291
+        $cosine_result = round(self::COSINE_PI_6*$size);
292
+        $half_size = round($size/2);
293 293
 
294 294
         return [
295 295
             0, $size, 0, 0,
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
      */
308 308
     private function getRightPoints($size = self::HEAD_BASE_SIZE): array
309 309
     {
310
-        $cosine_result = round(self::COSINE_PI_6 * $size);
311
-        $half_size = round($size / 2);
310
+        $cosine_result = round(self::COSINE_PI_6*$size);
311
+        $half_size = round($size/2);
312 312
 
313 313
         return [
314 314
             $size, 0, 0, 0,
Please login to merge, or discard this patch.
app/Image/Components/Component.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
      */
91 91
     public function getSideByIdentifier(string $side): Side
92 92
     {
93
-        return match ($side) {
93
+        return match($side) {
94 94
             Side::TOP => $this->getTop(),
95 95
             Side::BOTTOM => $this->getBottom(),
96 96
             Side::FRONT => $this->getFront(),
Please login to merge, or discard this patch.
app/Minecraft/MojangAccountFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
             return new MojangAccount($uuid, $username, $skin, $cape);
25 25
         }
26 26
 
27
-        $textures = array_filter($response['properties'], static function (array $entry) {
27
+        $textures = array_filter($response['properties'], static function(array $entry) {
28 28
             return $entry['name'] === 'textures';
29 29
         });
30 30
 
Please login to merge, or discard this patch.