Passed
Push — master ( 5d0e72...3ef39b )
by Jordan
03:58 queued 12s
created
src/Samsara/Fermat/Types/Traits/Decimal/ScaleTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $total = strlen($fractional);
106 106
         $fractional = ltrim($fractional, '0');
107 107
 
108
-        return ($total - strlen($fractional));
108
+        return ($total-strlen($fractional));
109 109
     }
110 110
 
111 111
     /**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     public function isFloat(): bool
192 192
     {
193 193
 
194
-        return (bool)ArithmeticProvider::compare($this->getDecimalPart(), '0');
194
+        return (bool) ArithmeticProvider::compare($this->getDecimalPart(), '0');
195 195
 
196 196
     }
197 197
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             );
207 207
         }
208 208
 
209
-        return (float)$this->asReal();
209
+        return (float) $this->asReal();
210 210
 
211 211
     }
212 212
 
Please login to merge, or discard this patch.
src/Samsara/Fermat/Provider/RoundingProvider.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $roundedPartString = $currentPart ? $decimalPart : $wholePart;
80 80
         $otherPart = $currentPart ? str_split($wholePart) : str_split($decimalPart);
81 81
         $baseLength = $currentPart ? strlen($decimalPart)-1 : strlen($wholePart);
82
-        $pos = $currentPart ? $places : $baseLength + $places;
82
+        $pos = $currentPart ? $places : $baseLength+$places;
83 83
         $carry = 0;
84 84
 
85 85
         if ($currentPart) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 break;
94 94
             }
95 95
 
96
-            $digit = (int)$roundedPart[$pos] + $carry;
96
+            $digit = (int) $roundedPart[$pos]+$carry;
97 97
 
98 98
             if ($carry == 0 && $digit == 5) {
99 99
                 static::$remainder = substr($roundedPartString, $pos+1);
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
 
104 104
             if ($pos == 0) {
105 105
                 if ($currentPart) {
106
-                    $nextDigit = (int)$otherPart[count($otherPart)-1];
106
+                    $nextDigit = (int) $otherPart[count($otherPart)-1];
107 107
                 } else {
108 108
                     $nextDigit = 0;
109 109
                 }
110 110
             } else {
111
-                $nextDigit = (int)$roundedPart[$pos-1];
111
+                $nextDigit = (int) $roundedPart[$pos-1];
112 112
             }
113 113
 
114 114
             if ($carry == 0) {
115
-                $carry = match (self::getRoundingMode()) {
115
+                $carry = match(self::getRoundingMode()) {
116 116
                     self::MODE_HALF_UP => self::roundHalfUp($digit),
117 117
                     self::MODE_HALF_DOWN => self::roundHalfDown($digit),
118 118
                     self::MODE_HALF_ODD => self::roundHalfOdd($digit, $nextDigit),
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         $remainder = self::remainderCheck();
240 240
 
241 241
         if ($early == 0) {
242
-            return ($nextDigit % 2 == 0 && !$remainder) ? 0 : 1;
242
+            return ($nextDigit%2 == 0 && !$remainder) ? 0 : 1;
243 243
         } else {
244 244
             return $early == 1 ? 1 : 0;
245 245
         }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $remainder = self::remainderCheck();
252 252
 
253 253
         if ($early == 0) {
254
-            return ($nextDigit % 2 == 1 && !$remainder) ? 0 : 1;
254
+            return ($nextDigit%2 == 1 && !$remainder) ? 0 : 1;
255 255
         } else {
256 256
             return $early == 1 ? 1 : 0;
257 257
         }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
         if ($early == 0 && !$remainder) {
303 303
             $val = self::$alt;
304
-            self::$alt = (int)!$val;
304
+            self::$alt = (int) !$val;
305 305
 
306 306
             return $val;
307 307
         } else {
@@ -319,9 +319,9 @@  discard block
 block discarded – undo
319 319
             $rangeMax = 9;
320 320
         } else {
321 321
             $remainder = substr($remainder, 0, 3);
322
-            $target = (int)($digit.$remainder);
322
+            $target = (int) ($digit.$remainder);
323 323
             $rangeMin = 0;
324
-            $rangeMax = (int)str_repeat('9', strlen($remainder) + 1);
324
+            $rangeMax = (int) str_repeat('9', strlen($remainder)+1);
325 325
         }
326 326
 
327 327
         $random = RandomProvider::randomInt($rangeMin, $rangeMax, RandomProvider::MODE_SPEED)->asInt();
Please login to merge, or discard this patch.