Failed Conditions
Pull Request — dev (#51)
by Jordan
03:19
created
src/Samsara/Fermat/Types/Traits/Arithmetic/ArithmeticPrecisionTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
         if (!$num->isWhole()) {
71 71
             $precision += 5;
72 72
             $exponent = $num->multiply($this->ln($precision));
73
-            return $exponent->exp($precision)->truncateToPrecision($precision - 5)->getValue();
73
+            return $exponent->exp($precision)->truncateToPrecision($precision-5)->getValue();
74 74
         }
75 75
 
76 76
         return ArithmeticProvider::pow($this->asReal(), $num->asReal(), $precision);
Please login to merge, or discard this patch.
src/Samsara/Fermat/Types/Traits/Arithmetic/ArithmeticNativeTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
         $left = self::translateToNative($this);
37 37
         $right = self::translateToNative($num);
38 38
 
39
-        $value = $left + $right;
40
-        $value = (string)$value;
39
+        $value = $left+$right;
40
+        $value = (string) $value;
41 41
 
42 42
         return $value;
43 43
     }
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
         $left = self::translateToNative($this);
48 48
         $right = self::translateToNative($num);
49 49
 
50
-        $value = $left - $right;
51
-        $value = (string)$value;
50
+        $value = $left-$right;
51
+        $value = (string) $value;
52 52
 
53 53
         return $value;
54 54
     }
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
         $left = self::translateToNative($this);
59 59
         $right = self::translateToNative($num);
60 60
 
61
-        $value = $left * $right;
62
-        $value = (string)$value;
61
+        $value = $left*$right;
62
+        $value = (string) $value;
63 63
 
64 64
         return $value;
65 65
     }
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
         $left = self::translateToNative($this);
70 70
         $right = self::translateToNative($num);
71 71
 
72
-        $value = $left / $right;
73
-        $value = (string)$value;
72
+        $value = $left/$right;
73
+        $value = (string) $value;
74 74
 
75 75
         return $value;
76 76
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $right = self::translateToNative($num);
82 82
 
83 83
         $value = pow($left, $right);
84
-        $value = (string)$value;
84
+        $value = (string) $value;
85 85
 
86 86
         return $value;
87 87
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     protected function sqrtNative()
90 90
     {
91 91
         $value = sqrt($this->asFloat());
92
-        $value = (string)$value;
92
+        $value = (string) $value;
93 93
 
94 94
         return $value;
95 95
     }
Please login to merge, or discard this patch.
src/Samsara/Fermat/Types/Traits/Decimal/PrecisionTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
                 $rounded = $whole.'.';
56 56
 
57
-                for ($i = 0;$i < $decimals;$i++) {
57
+                for ($i = 0; $i < $decimals; $i++) {
58 58
                     $rounded .= $fractionalArr[$i];
59 59
                 }
60 60
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $total = strlen($fractional);
143 143
         $fractional = ltrim($fractional, '0');
144 144
 
145
-        return ($total - strlen($fractional));
145
+        return ($total-strlen($fractional));
146 146
     }
147 147
 
148 148
     /**
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     public function isFloat(): bool
225 225
     {
226 226
 
227
-        return (bool)ArithmeticProvider::compare($this->getDecimalPart(), '0');
227
+        return (bool) ArithmeticProvider::compare($this->getDecimalPart(), '0');
228 228
 
229 229
     }
230 230
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
             throw new IncompatibleObjectState('Cannot export number as integer because it is out of range');
236 236
         }
237 237
 
238
-        return (float)$this->asReal();
238
+        return (float) $this->asReal();
239 239
 
240 240
     }
241 241
 
Please login to merge, or discard this patch.