Test Failed
Pull Request — master (#141)
by Jordan
06:39
created
src/Samsara/Fermat/Complex/Types/ComplexNumber.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 {
29 29
 
30 30
     /** @var ImmutableDecimal|ImmutableFraction */
31
-    protected ImmutableDecimal|ImmutableFraction $realPart;
31
+    protected ImmutableDecimal | ImmutableFraction $realPart;
32 32
     /** @var ImmutableDecimal|ImmutableFraction */
33
-    protected ImmutableDecimal|ImmutableFraction $imaginaryPart;
33
+    protected ImmutableDecimal | ImmutableFraction $imaginaryPart;
34 34
     /** @var int */
35 35
     protected int $scale;
36 36
     protected CartesianCoordinate $cachedCartesian;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         return false;
131 131
     }
132 132
 
133
-    public function asReal(): ImmutableDecimal|ImmutableFraction
133
+    public function asReal(): ImmutableDecimal | ImmutableFraction
134 134
     {
135 135
         return (new ImmutableDecimal($this->getAsBaseTenRealNumber(), $this->getScale()))->setMode($this->getMode());
136 136
     }
Please login to merge, or discard this patch.
src/Samsara/Fermat/Complex/Types/Traits/ArithmeticComplexTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         ] = $this->translateToParts($this, $num, 1);
152 152
 
153 153
         if ($num->isComplex()) {
154
-            $intScale = $scale + 2;
154
+            $intScale = $scale+2;
155 155
             $denominator = $thatRealPart->roundToScale($intScale)->pow(2)->add($thatImaginaryPart->asReal()->roundToScale($intScale)->pow(2));
156 156
 
157 157
             $partA = $thisRealPart->roundToScale($intScale)->multiply($thatRealPart->roundToScale($intScale))
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         if ($num->isReal() && $num->isNatural() && $num->isPositive()) {
203 203
             $newValue = clone $this;
204 204
 
205
-            for ($i=0;$num->isGreaterThan($i);$i++) {
205
+            for ($i = 0;$num->isGreaterThan($i);$i++) {
206 206
                 $newValue = $newValue->multiply($this);
207 207
             }
208 208
 
Please login to merge, or discard this patch.
src/Samsara/Fermat/Coordinates/Values/PolarCoordinate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
     public function asCartesian(?int $scale = null): CartesianCoordinate
45 45
     {
46 46
         $scale = $scale ?? 10;
47
-        $intScale = $scale + 2;
47
+        $intScale = $scale+2;
48 48
 
49 49
         if (is_null($this->cachedCartesian)) {
50 50
             $x = $this->getAxis('rho')->multiply($this->getAxis('theta')->cos($intScale))->roundToScale($scale);
Please login to merge, or discard this patch.
src/Samsara/Fermat/Coordinates/Values/CartesianCoordinate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     public function getDistanceFromOrigin(?int $scale = null): ImmutableDecimal
77 77
     {
78 78
         $scale = $scale ?? 10;
79
-        $intScale = $scale + 2;
79
+        $intScale = $scale+2;
80 80
 
81 81
         $x = 0;
82 82
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     public function distanceTo(CoordinateInterface $coordinate, ?int $scale = null): ImmutableDecimal
106 106
     {
107 107
         $scale = $scale ?? 10;
108
-        $intScale = $scale + 2;
108
+        $intScale = $scale+2;
109 109
 
110 110
         if (!($coordinate instanceof CartesianCoordinate)) {
111 111
             $coordinate = $coordinate->asCartesian();
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     public function asPolar(?int $scale = null): PolarCoordinate
228 228
     {
229 229
         $scale = $scale ?? 10;
230
-        $intScale = $scale + 3;
230
+        $intScale = $scale+3;
231 231
 
232 232
         if ($this->numberOfDimensions() !== 2) {
233 233
             throw new IncompatibleObjectState(
Please login to merge, or discard this patch.
src/Samsara/Fermat/Core/Types/Fraction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
240 240
     /**
241 241
      * @return ImmutableDecimal|ImmutableFraction
242 242
      */
243
-    public function asReal(): ImmutableDecimal|ImmutableFraction
243
+    public function asReal(): ImmutableDecimal | ImmutableFraction
244 244
     {
245 245
         return (new ImmutableFraction($this->getNumerator()->getAsBaseTenRealNumber(), $this->getDenominator()->getAsBaseTenRealNumber()))->setMode($this->getMode());
246 246
     }
Please login to merge, or discard this patch.
src/Samsara/Fermat/Core/Types/Decimal.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
                 if ($exp > 0) {
115 115
                     $exp -= strlen($right);
116 116
                     if ($exp >= 0) {
117
-                        $right = str_pad($right, $exp - 1, '0').'.0';
117
+                        $right = str_pad($right, $exp-1, '0').'.0';
118 118
                     } else {
119
-                        $right = substr($right, 0, strlen($right) + abs($exp)).'.'.substr($right, strlen($right) + abs($exp) + 1);
119
+                        $right = substr($right, 0, strlen($right)+abs($exp)).'.'.substr($right, strlen($right)+abs($exp)+1);
120 120
                     }
121 121
                 } else {
122 122
                     $exp += strlen($left);
123 123
                     if ($exp >= 0) {
124
-                        $left = substr($left, 0, $exp).'.'.substr($left, $exp + 1);
124
+                        $left = substr($left, 0, $exp).'.'.substr($left, $exp+1);
125 125
                     } else {
126 126
                         $left = '0.'.str_pad($left, abs($exp)+1, '0', STR_PAD_LEFT);
127 127
                     }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         return $string;
191 191
     }
192 192
 
193
-    public function asReal(): ImmutableDecimal|ImmutableFraction
193
+    public function asReal(): ImmutableDecimal | ImmutableFraction
194 194
     {
195 195
         return (new ImmutableDecimal($this->getAsBaseTenRealNumber(), $this->getScale()))->setMode($this->getMode());
196 196
     }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      * @param NumberBase $base
265 265
      * @return DecimalInterface|NumberInterface
266 266
      */
267
-    public function setBase(NumberBase $base): DecimalInterface|NumberInterface
267
+    public function setBase(NumberBase $base): DecimalInterface | NumberInterface
268 268
     {
269 269
         $this->base = $base;
270 270
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
      *
277 277
      * @return DecimalInterface|NumberInterface
278 278
      */
279
-    public function abs(): DecimalInterface|NumberInterface
279
+    public function abs(): DecimalInterface | NumberInterface
280 280
     {
281 281
         $newValue = $this->absValue();
282 282
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      * @param DecimalInterface $num
288 288
      * @return float|int
289 289
      */
290
-    protected static function translateToNative(DecimalInterface $num): float|int
290
+    protected static function translateToNative(DecimalInterface $num): float | int
291 291
     {
292 292
         return ($num->isInt() ? $num->asInt() : $num->asFloat());
293 293
     }
@@ -340,13 +340,13 @@  discard block
 block discarded – undo
340 340
      * @param bool $setToNewBase
341 341
      * @return DecimalInterface
342 342
      */
343
-    abstract protected function setValue(string $value, ?int $scale = null, ?NumberBase $base = null, bool $setToNewBase = false): DecimalInterface; // TODO: Check usages for base correctness & preservation
343
+    abstract protected function setValue(string $value, ?int $scale = null, ?NumberBase $base = null, bool $setToNewBase = false): DecimalInterface;// TODO: Check usages for base correctness & preservation
344 344
 
345 345
     /**
346 346
      * @param NumberInterface|string|int|float $mod
347 347
      * @return DecimalInterface
348 348
      */
349
-    abstract public function continuousModulo(NumberInterface|string|int|float $mod): DecimalInterface;
349
+    abstract public function continuousModulo(NumberInterface | string | int | float $mod): DecimalInterface;
350 350
 
351 351
     /**
352 352
      * @param string $decimalPart
Please login to merge, or discard this patch.
src/Samsara/Fermat/Core/Types/Base/Number.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     /**
114 114
      * @return ImmutableDecimal|ImmutableFraction
115 115
      */
116
-    abstract public function asReal(): ImmutableDecimal|ImmutableFraction;
116
+    abstract public function asReal(): ImmutableDecimal | ImmutableFraction;
117 117
 
118 118
     /**
119 119
      * @return string
Please login to merge, or discard this patch.
src/Samsara/Fermat/Core/Types/Base/Interfaces/Numbers/NumberInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return bool
72 72
      */
73
-    public function isEqual(NumberInterface|int|string|float $value): bool;
73
+    public function isEqual(NumberInterface | int | string | float $value): bool;
74 74
 
75 75
     /**
76 76
      * @return int|null
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     /**
91 91
      * @return ImmutableDecimal|ImmutableFraction
92 92
      */
93
-    public function asReal(): ImmutableDecimal|ImmutableFraction;
93
+    public function asReal(): ImmutableDecimal | ImmutableFraction;
94 94
 
95 95
     /**
96 96
      * @return bool
Please login to merge, or discard this patch.
src/Samsara/Fermat/Core/Types/Traits/Arithmetic/ArithmeticScaleTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $scale = ($this->getScale() > $num->getScale()) ? $this->getScale() : $num->getScale();
69 69
         }
70 70
 
71
-        $scale = $scale + $this->numberOfLeadingZeros() + $num->numberOfLeadingZeros();
71
+        $scale = $scale+$this->numberOfLeadingZeros()+$num->numberOfLeadingZeros();
72 72
 
73 73
         return ArithmeticProvider::divide($this->getAsBaseTenRealNumber(), $num->getAsBaseTenRealNumber(), $scale+1);
74 74
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         $scale = ($this->getScale() > $num->getScale()) ? $this->getScale() : $num->getScale();
86 86
 
87
-        $scale += $this->numberOfDecimalDigits() + $num->numberOfDecimalDigits();
87
+        $scale += $this->numberOfDecimalDigits()+$num->numberOfDecimalDigits();
88 88
 
89 89
         if ($this->isWhole() && $num->isPositive() && $num->isWhole() && $num->isLessThan(PHP_INT_MAX)) {
90 90
             return gmp_strval(gmp_pow($this->getAsBaseTenRealNumber(), $num->asInt()));
Please login to merge, or discard this patch.