Passed
Branch master (49aa74)
by Kevin
02:55
created
Category
src/Math/LargestRemainder.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
     /**
8 8
      * @var array
9 9
      */
10
-    private $numbers = [];
10
+    private $numbers = [ ];
11 11
 
12 12
     /**
13 13
      * @var int
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
     public function round(): array
37 37
     {
38 38
         return $this->uround(
39
-            function ($item) {
39
+            function($item) {
40 40
                 return $item;
41 41
             },
42
-            function (&$item, $value) {
42
+            function(&$item, $value) {
43 43
                 $item = $value;
44 44
             }
45 45
         );
@@ -54,33 +54,33 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $originalOrder = array_keys($this->numbers);
56 56
 
57
-        $sum = array_sum(array_map(function ($item) use ($get) {
58
-            return floor($this->normalize(call_user_func_array($get, [$item])));
57
+        $sum = array_sum(array_map(function($item) use ($get) {
58
+            return floor($this->normalize(call_user_func_array($get, [ $item ])));
59 59
         }, $this->numbers));
60 60
 
61 61
         $diff = 100 - $sum;
62 62
 
63
-        uasort($this->numbers, function ($a, $b) use ($get) {
64
-            $aNumber = $this->normalize(call_user_func_array($get, [$a]));
65
-            $bNumber = $this->normalize(call_user_func_array($get, [$b]));
63
+        uasort($this->numbers, function($a, $b) use ($get) {
64
+            $aNumber = $this->normalize(call_user_func_array($get, [ $a ]));
65
+            $bNumber = $this->normalize(call_user_func_array($get, [ $b ]));
66 66
             return $aNumber - floor($aNumber) < $bNumber - floor($bNumber);
67 67
         });
68 68
 
69 69
         $index = 0;
70 70
         foreach ($this->numbers as &$item) {
71
-            $number = call_user_func_array($get, [&$item]);
71
+            $number = call_user_func_array($get, [ &$item ]);
72 72
             $normalized = $this->normalize($number);
73 73
             if ($index < $diff) {
74
-                call_user_func_array($set, [&$item, $this->denormalize(floor($normalized + 1))]);
74
+                call_user_func_array($set, [ &$item, $this->denormalize(floor($normalized + 1)) ]);
75 75
                 $index++;
76 76
                 continue;
77 77
             }
78 78
             if ($diff < 0 && $index < $diff * (-1)) {
79
-                call_user_func_array($set, [&$item, $this->denormalize(floor($normalized - 1))]);
79
+                call_user_func_array($set, [ &$item, $this->denormalize(floor($normalized - 1)) ]);
80 80
                 $index++;
81 81
                 continue;
82 82
             }
83
-            call_user_func_array($set, [&$item, $this->denormalize(floor($normalized))]);
83
+            call_user_func_array($set, [ &$item, $this->denormalize(floor($normalized)) ]);
84 84
             $index++;
85 85
             continue;
86 86
         }
Please login to merge, or discard this patch.