Passed
Pull Request — master (#7)
by Mattia
08:44 queued 04:19
created
app/Image/LayerValidator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
             ++$x;
63 63
         }
64 64
         // mean value for each color
65
-        $totalPixels = $side->getWidth() * $side->getHeight();
66
-        $meanRed = \array_sum($allRed) / $totalPixels;
67
-        $meanGreen = \array_sum($allGreen) / $totalPixels;
68
-        $meanBlue = \array_sum($allBlue) / $totalPixels;
69
-        $this->meanAlpha = (int) \round(\array_sum($allAlpha) / $totalPixels);
65
+        $totalPixels = $side->getWidth()*$side->getHeight();
66
+        $meanRed = \array_sum($allRed)/$totalPixels;
67
+        $meanGreen = \array_sum($allGreen)/$totalPixels;
68
+        $meanBlue = \array_sum($allBlue)/$totalPixels;
69
+        $this->meanAlpha = (int) \round(\array_sum($allAlpha)/$totalPixels);
70 70
         // Arrays deviation
71 71
         $devsRed = [];
72 72
         $devsGreen = [];
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
             ++$i;
80 80
         }
81 81
         // stddev for each color
82
-        $this->redStdDev = \sqrt(\array_sum($devsRed) / $totalPixels);
83
-        $this->greenStdDev = \sqrt(\array_sum($devsGreen) / $totalPixels);
84
-        $this->blueStdDev = \sqrt(\array_sum($devsBlue) / $totalPixels);
82
+        $this->redStdDev = \sqrt(\array_sum($devsRed)/$totalPixels);
83
+        $this->greenStdDev = \sqrt(\array_sum($devsGreen)/$totalPixels);
84
+        $this->blueStdDev = \sqrt(\array_sum($devsBlue)/$totalPixels);
85 85
     }
86 86
 
87 87
     /**
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/Sections/BaseSkinSection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@
 block discarded – undo
32 32
 
33 33
         $this->patchOldSkin($tmpImageResource);
34 34
 
35
-        $scale = $skinHeight / $this->baseImageHeight;
35
+        $scale = $skinHeight/$this->baseImageHeight;
36 36
         if ($scale === 0) {
37 37
             $scale = 1;
38 38
         }
39
-        $skinWidth = (int) \round($scale * ($this->baseImageWidth));
39
+        $skinWidth = (int) \round($scale*($this->baseImageWidth));
40 40
 
41 41
         $this->imgResource = $this->emptyBaseImage($skinWidth, $skinHeight);
42 42
         \imagecopyresized($this->imgResource, $tmpImageResource, 0, 0, 0, 0, $skinWidth, $skinHeight, $this->baseImageWidth, $this->baseImageHeight);
Please login to merge, or discard this patch.
app/Image/Components/Coordinates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     public const HEAD = [
15 15
         Side::TOP => [[8, 0], [16, 8]],
16 16
         Side::BOTTOM => [[16, 0], [24, 8]],
17
-        Side::FRONT => [[8, 8],  [16, 16]],
17
+        Side::FRONT => [[8, 8], [16, 16]],
18 18
         Side::BACK => [[24, 8], [32, 16]],
19 19
         Side::RIGHT => [[0, 8], [8, 16]],
20 20
         Side::LEFT => [[16, 8], [24, 16]],
Please login to merge, or discard this patch.
app/Http/Controllers/Api/SkinFrontController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      */
39 39
     public function serveDefault($size = 0): Response
40 40
     {
41
-        $image = $this->cache()->remember('rendering.system.default_skin_front', 3600, function () use ($size) {
41
+        $image = $this->cache()->remember('rendering.system.default_skin_front', 3600, function() use ($size) {
42 42
             return (string) $this->rendering->skinFront(
43 43
                 null,
44 44
                 (int) $size
Please login to merge, or discard this patch.
app/Http/Controllers/Api/SkinBackController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function serveDefault($size = 0): Response
41 41
     {
42
-        $image = $this->cache()->remember('rendering.system.default_skin_back', 3600, function () use ($size) {
42
+        $image = $this->cache()->remember('rendering.system.default_skin_back', 3600, function() use ($size) {
43 43
             return (string) $this->rendering->skinBack(
44 44
                 null,
45 45
                 (int) $size
Please login to merge, or discard this patch.
app/Http/Controllers/Api/DownloadTextureController.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
57 57
         $this->uuidResolver->resolve($uuid);
58 58
 
59 59
         $skinPath = $this->uuidResolver->resolve($uuid) ?
60
-            SkinsStorage::getPath($this->uuidResolver->getUuid()) :
61
-            SkinsStorage::getPath(MinecraftDefaults::STEVE_DEFAULT_SKIN_NAME);
60
+            SkinsStorage::getPath($this->uuidResolver->getUuid()) : SkinsStorage::getPath(MinecraftDefaults::STEVE_DEFAULT_SKIN_NAME);
62 61
 
63 62
         $rawSkin = new Raw($skinPath);
64 63
         $rawSkin->render();
Please login to merge, or discard this patch.