Passed
Pull Request — master (#134)
by Jordan
06:45
created
src/Samsara/Fermat/Provider/RoundingProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $roundedPartString = $currentPart ? $decimalPart : $wholePart;
61 61
         $otherPart = $currentPart ? str_split($wholePart) : str_split($decimalPart);
62 62
         $baseLength = $currentPart ? strlen($decimalPart)-1 : strlen($wholePart);
63
-        $pos = $currentPart ? $places : $baseLength + $places;
63
+        $pos = $currentPart ? $places : $baseLength+$places;
64 64
 
65 65
         if ($currentPart) {
66 66
             $pos = ($absPlaces > $baseLength && $places < 0) ? $baseLength : $pos;
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 break;
145 145
             }
146 146
 
147
-            $digit = (int)$roundedPart[$pos] + $carry;
147
+            $digit = (int) $roundedPart[$pos]+$carry;
148 148
 
149 149
             if ($carry == 0 && $digit == 5) {
150 150
                 static::$remainder = substr($roundedPartString, $pos+1);
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
 
155 155
             if ($pos == 0) {
156 156
                 if ($currentPart) {
157
-                    $nextDigit = (int)$otherPart[count($otherPart)-1];
157
+                    $nextDigit = (int) $otherPart[count($otherPart)-1];
158 158
                 } else {
159 159
                     $nextDigit = 0;
160 160
                 }
161 161
             } else {
162
-                $nextDigit = (int)$roundedPart[$pos-1];
162
+                $nextDigit = (int) $roundedPart[$pos-1];
163 163
             }
164 164
 
165 165
             if ($carry == 0) {
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         $remainder = self::remainderCheck();
271 271
 
272 272
         if ($early == 0) {
273
-            return ($nextDigit % 2 == 0 && !$remainder) ? 0 : 1;
273
+            return ($nextDigit%2 == 0 && !$remainder) ? 0 : 1;
274 274
         } else {
275 275
             return $early == 1 ? 1 : 0;
276 276
         }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         $remainder = self::remainderCheck();
283 283
 
284 284
         if ($early == 0) {
285
-            return ($nextDigit % 2 == 1 && !$remainder) ? 0 : 1;
285
+            return ($nextDigit%2 == 1 && !$remainder) ? 0 : 1;
286 286
         } else {
287 287
             return $early == 1 ? 1 : 0;
288 288
         }
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
         if ($early == 0 && !$remainder) {
334 334
             $val = self::$alt;
335
-            self::$alt = (int)!$val;
335
+            self::$alt = (int) !$val;
336 336
 
337 337
             return $val;
338 338
         } else {
@@ -350,9 +350,9 @@  discard block
 block discarded – undo
350 350
             $rangeMax = 9;
351 351
         } else {
352 352
             $remainder = substr($remainder, 0, 3);
353
-            $target = (int)($digit.$remainder);
353
+            $target = (int) ($digit.$remainder);
354 354
             $rangeMin = 0;
355
-            $rangeMax = (int)str_repeat('9', strlen($remainder) + 1);
355
+            $rangeMax = (int) str_repeat('9', strlen($remainder)+1);
356 356
         }
357 357
 
358 358
         $random = RandomProvider::randomInt($rangeMin, $rangeMax, RandomMode::Speed)->asInt();
Please login to merge, or discard this patch.