Test Failed
Pull Request — master (#127)
by Jordan
06:34
created
src/Samsara/Fermat/Types/Base/Interfaces/Numbers/NumberInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
      *
70 70
      * @return bool
71 71
      */
72
-    public function isEqual(NumberInterface|int|string|float $value): bool;
72
+    public function isEqual(NumberInterface | int | string | float $value): bool;
73 73
 
74 74
     /**
75 75
      * @return int|null
Please login to merge, or discard this patch.
src/Samsara/Fermat/Types/Base/Interfaces/Numbers/DecimalInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      *
25 25
      * @return DecimalInterface
26 26
      */
27
-    public function continuousModulo(NumberInterface|string|int|float $mod): DecimalInterface;
27
+    public function continuousModulo(NumberInterface | string | int | float $mod): DecimalInterface;
28 28
 
29 29
     /**
30 30
      * @param $num
Please login to merge, or discard this patch.
src/Samsara/Fermat/Types/Traits/Decimal/LogScaleTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         } else {
33 33
             $x = $this instanceof ImmutableDecimal ? $this : new ImmutableDecimal($this->getValue(NumberBase::Ten));
34 34
             $x2 = $x->pow(2);
35
-            $intScale = $scale + 1;
35
+            $intScale = $scale+1;
36 36
             $terms = $scale;
37 37
             $six = new ImmutableDecimal(6);
38 38
 
39
-            $aPart = new class($x2, $x) implements ContinuedFractionTermInterface{
39
+            $aPart = new class($x2, $x) implements ContinuedFractionTermInterface {
40 40
                 private ImmutableDecimal $x2;
41 41
                 private ImmutableDecimal $x;
42 42
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                 }
65 65
             };
66 66
 
67
-            $bPart = new class($x, $six) implements ContinuedFractionTermInterface{
67
+            $bPart = new class($x, $six) implements ContinuedFractionTermInterface {
68 68
                 private ImmutableDecimal $x;
69 69
                 private ImmutableDecimal $six;
70 70
 
Please login to merge, or discard this patch.
src/Samsara/Fermat/Types/Traits/Decimal/LogSelectionTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $calcMode = $this->getMode();
24 24
 
25 25
         return match ($calcMode) {
26
-            CalcMode::Native => (string)$this->expNative(),
26
+            CalcMode::Native => (string) $this->expNative(),
27 27
             default => $this->expScale($scale)
28 28
         };
29 29
     }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $calcMode = $this->getMode();
40 40
 
41 41
         return match ($calcMode) {
42
-            CalcMode::Native => (string)$this->lnNative(),
42
+            CalcMode::Native => (string) $this->lnNative(),
43 43
             default => $this->lnScale($scale)
44 44
         };
45 45
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $calcMode = $this->getMode();
55 55
 
56 56
         return match ($calcMode) {
57
-            CalcMode::Native => (string)$this->log10Native(),
57
+            CalcMode::Native => (string) $this->log10Native(),
58 58
             default => $this->log10Scale($scale)
59 59
         };
60 60
     }
Please login to merge, or discard this patch.
src/Samsara/Fermat/Types/Traits/Decimal/ScaleTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $total = strlen($fractional);
148 148
         $fractional = ltrim($fractional, '0');
149 149
 
150
-        return ($total - strlen($fractional));
150
+        return ($total-strlen($fractional));
151 151
     }
152 152
 
153 153
     /**
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     public function isFloat(): bool
235 235
     {
236 236
 
237
-        return (bool)ArithmeticProvider::compare($this->getDecimalPart(), '0');
237
+        return (bool) ArithmeticProvider::compare($this->getDecimalPart(), '0');
238 238
 
239 239
     }
240 240
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      */
244 244
     public function asFloat(): float
245 245
     {
246
-        return (float)$this->asReal();
246
+        return (float) $this->asReal();
247 247
     }
248 248
 
249 249
     /**
Please login to merge, or discard this patch.
src/Samsara/Fermat/Types/Traits/Trigonometry/TrigonometrySelectionTrait.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $calcMode = $this->getMode();
21 21
 
22 22
         return match ($calcMode) {
23
-            CalcMode::Native => (string)$this->sinNative(),
23
+            CalcMode::Native => (string) $this->sinNative(),
24 24
             default => $this->sinScale($scale)
25 25
         };
26 26
     }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $calcMode = $this->getMode();
35 35
 
36 36
         return match ($calcMode) {
37
-            CalcMode::Native => (string)$this->cosNative(),
37
+            CalcMode::Native => (string) $this->cosNative(),
38 38
             default => $this->cosScale($scale)
39 39
         };
40 40
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $calcMode = $this->getMode();
49 49
 
50 50
         return match ($calcMode) {
51
-            CalcMode::Native => (string)$this->tanNative(),
51
+            CalcMode::Native => (string) $this->tanNative(),
52 52
             default => $this->tanScale($scale)
53 53
         };
54 54
     }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $calcMode = $this->getMode();
64 64
 
65 65
         return match ($calcMode) {
66
-            CalcMode::Native => (string)$this->secNative(),
66
+            CalcMode::Native => (string) $this->secNative(),
67 67
             default => $this->secScale($scale)
68 68
         };
69 69
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $calcMode = $this->getMode();
79 79
 
80 80
         return match ($calcMode) {
81
-            CalcMode::Native => (string)$this->cscNative(),
81
+            CalcMode::Native => (string) $this->cscNative(),
82 82
             default => $this->cscScale($scale)
83 83
         };
84 84
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $calcMode = $this->getMode();
94 94
 
95 95
         return match ($calcMode) {
96
-            CalcMode::Native => (string)$this->cotNative(),
96
+            CalcMode::Native => (string) $this->cotNative(),
97 97
             default => $this->cotScale($scale)
98 98
         };
99 99
     }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $calcMode = $this->getMode();
108 108
 
109 109
         return match ($calcMode) {
110
-            CalcMode::Native => (string)$this->sinhNative(),
110
+            CalcMode::Native => (string) $this->sinhNative(),
111 111
             default => $this->sinhScale($scale)
112 112
         };
113 113
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $calcMode = $this->getMode();
122 122
 
123 123
         return match ($calcMode) {
124
-            CalcMode::Native => (string)$this->coshNative(),
124
+            CalcMode::Native => (string) $this->coshNative(),
125 125
             default => $this->coshScale($scale)
126 126
         };
127 127
     }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $calcMode = $this->getMode();
136 136
 
137 137
         return match ($calcMode) {
138
-            CalcMode::Native => (string)$this->tanhNative(),
138
+            CalcMode::Native => (string) $this->tanhNative(),
139 139
             default => $this->tanhScale($scale)
140 140
         };
141 141
     }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         $calcMode = $this->getMode();
151 151
 
152 152
         return match ($calcMode) {
153
-            CalcMode::Native => (string)$this->sechNative(),
153
+            CalcMode::Native => (string) $this->sechNative(),
154 154
             default => $this->sechScale($scale)
155 155
         };
156 156
     }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $calcMode = $this->getMode();
165 165
 
166 166
         return match ($calcMode) {
167
-            CalcMode::Native => (string)$this->cschNative(),
167
+            CalcMode::Native => (string) $this->cschNative(),
168 168
             default => $this->cschScale($scale)
169 169
         };
170 170
     }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $calcMode = $this->getMode();
180 180
 
181 181
         return match ($calcMode) {
182
-            CalcMode::Native => (string)$this->cothNative(),
182
+            CalcMode::Native => (string) $this->cothNative(),
183 183
             default => $this->cothScale($scale)
184 184
         };
185 185
     }
Please login to merge, or discard this patch.
Samsara/Fermat/Types/Traits/Trigonometry/InverseTrigonometryNativeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         $thisNum = self::translateToNative($this);
69 69
         $piDiv2 = M_PI_2;
70 70
 
71
-        return $piDiv2 - atan($thisNum);
71
+        return $piDiv2-atan($thisNum);
72 72
     }
73 73
 
74 74
 }
75 75
\ No newline at end of file
Please login to merge, or discard this patch.
Samsara/Fermat/Types/Traits/Trigonometry/InverseTrigonometryScaleTrait.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
         } else {
44 44
             $abs = $this instanceof ImmutableDecimal ? $this->abs() : new ImmutableDecimal($this->absValue());
45 45
             $addScale = $abs->asInt() > $abs->getScale() ? $abs->asInt() : $abs->getScale();
46
-            $intScale = $scale + $addScale;
46
+            $intScale = $scale+$addScale;
47 47
             $x = new ImmutableDecimal($this->getValue(NumberBase::Ten), $intScale);
48 48
             $x2 = $x->pow(2);
49 49
             $one = new ImmutableDecimal(1, $intScale);
50 50
 
51
-            $aPart = new class($x2, $intScale) implements ContinuedFractionTermInterface{
51
+            $aPart = new class($x2, $intScale) implements ContinuedFractionTermInterface {
52 52
                 private ImmutableDecimal $x2;
53 53
                 private ImmutableDecimal $negTwo;
54 54
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 }
77 77
             };
78 78
 
79
-            $bPart = new class() implements ContinuedFractionTermInterface{
79
+            $bPart = new class() implements ContinuedFractionTermInterface {
80 80
                 /**
81 81
                  * @param int $n
82 82
                  * @return ImmutableDecimal
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         } elseif ($this->isEqual(1)) {
118 118
             $answer = Numbers::makeZero();
119 119
         } else {
120
-            $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale + 2);
120
+            $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale+2);
121 121
 
122 122
             $answer = $piDivTwo->subtract($z->arcsin($scale+2));
123 123
         }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
         $scale = $scale ?? $this->getScale();
140 140
         $abs = $this instanceof ImmutableDecimal ? $this->abs() : new ImmutableDecimal($this->absValue());
141
-        $intScale = $scale + 2;
141
+        $intScale = $scale+2;
142 142
         $terms = $abs->multiply($intScale+8)->asInt();
143 143
         $x = new ImmutableDecimal($this->getValue(NumberBase::Ten), $intScale);
144 144
         $aPart = new class($x) implements ContinuedFractionTermInterface {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                     return Numbers::makeZero($this->intScale);
188 188
                 }
189 189
 
190
-                return SequenceProvider::nthOddNumber($n - 1)->truncateToScale($this->intScale);
190
+                return SequenceProvider::nthOddNumber($n-1)->truncateToScale($this->intScale);
191 191
             }
192 192
         };
193 193
 
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 
209 209
         $scale = $scale ?? $this->getScale();
210 210
 
211
-        $piDivTwo = Numbers::makePi($scale + 2)->divide(2, $scale + 2);
211
+        $piDivTwo = Numbers::makePi($scale+2)->divide(2, $scale+2);
212 212
 
213
-        $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale + 2);
213
+        $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale+2);
214 214
 
215 215
         $arctan = $z->arctan($scale+2, false);
216 216
 
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 
231 231
         $scale = $scale ?? $this->getScale();
232 232
 
233
-        $one = Numbers::makeOne($scale + 2);
233
+        $one = Numbers::makeOne($scale+2);
234 234
         $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale+2);
235 235
 
236
-        $answer = $one->divide($z, $scale + 2)->arccos($scale + 2);
236
+        $answer = $one->divide($z, $scale+2)->arccos($scale+2);
237 237
 
238 238
         return $answer->getAsBaseTenRealNumber();
239 239
 
@@ -249,10 +249,10 @@  discard block
 block discarded – undo
249 249
 
250 250
         $scale = $scale ?? $this->getScale();
251 251
 
252
-        $one = Numbers::makeOne($scale + 2);
252
+        $one = Numbers::makeOne($scale+2);
253 253
         $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale+2);
254 254
 
255
-        $answer = $one->divide($z, $scale + 2)->arcsin($scale + 2);
255
+        $answer = $one->divide($z, $scale+2)->arcsin($scale+2);
256 256
 
257 257
         return $answer->getAsBaseTenRealNumber();
258 258
 
Please login to merge, or discard this patch.
Fermat/Types/Traits/Trigonometry/InverseTrigonometrySelectionTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         $calcMode = $this->getMode();
20 20
 
21 21
         return match ($calcMode) {
22
-            CalcMode::Native => (string)$this->arcsinNative(),
22
+            CalcMode::Native => (string) $this->arcsinNative(),
23 23
             default => $this->arcsinScale($scale)
24 24
         };
25 25
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $calcMode = $this->getMode();
34 34
 
35 35
         return match ($calcMode) {
36
-            CalcMode::Native => (string)$this->arccosNative(),
36
+            CalcMode::Native => (string) $this->arccosNative(),
37 37
             default => $this->arccosScale($scale)
38 38
         };
39 39
     }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $calcMode = $this->getMode();
48 48
 
49 49
         return match ($calcMode) {
50
-            CalcMode::Native => (string)$this->arctanNative(),
50
+            CalcMode::Native => (string) $this->arctanNative(),
51 51
             default => $this->arctanScale($scale)
52 52
         };
53 53
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $calcMode = $this->getMode();
62 62
 
63 63
         return match ($calcMode) {
64
-            CalcMode::Native => (string)$this->arcsecNative(),
64
+            CalcMode::Native => (string) $this->arcsecNative(),
65 65
             default => $this->arcsecScale($scale)
66 66
         };
67 67
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $calcMode = $this->getMode();
76 76
 
77 77
         return match ($calcMode) {
78
-            CalcMode::Native => (string)$this->arccscNative(),
78
+            CalcMode::Native => (string) $this->arccscNative(),
79 79
             default => $this->arccscScale($scale)
80 80
         };
81 81
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $calcMode = $this->getMode();
90 90
 
91 91
         return match ($calcMode) {
92
-            CalcMode::Native => (string)$this->arccotNative(),
92
+            CalcMode::Native => (string) $this->arccotNative(),
93 93
             default => $this->arccotScale($scale)
94 94
         };
95 95
     }
Please login to merge, or discard this patch.