Completed
Pull Request — develop (#19)
by Victor
02:37 queued 16s
created
Math/Library/Spl.php 1 patch
Spacing   +7 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function add(string $leftOperand, string $rightOperand, int $precision = 0): string
37 37
     {
38
-        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) + intval($rightOperand)) :
39
-            round(floatval($leftOperand) + floatval($rightOperand), $precision, $this->roundingStrategy));
38
+        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) + intval($rightOperand)) : round(floatval($leftOperand) + floatval($rightOperand), $precision, $this->roundingStrategy));
40 39
     }
41 40
 
42 41
     /**
@@ -50,8 +49,7 @@  discard block
 block discarded – undo
50 49
      */
51 50
     public function subtract(string $leftOperand, string $rightOperand, int $precision = 0): string
52 51
     {
53
-        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) - intval($rightOperand)) :
54
-            round($leftOperand - $rightOperand, $precision, $this->roundingStrategy));
52
+        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) - intval($rightOperand)) : round($leftOperand - $rightOperand, $precision, $this->roundingStrategy));
55 53
     }
56 54
 
57 55
     /**
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
      */
66 64
     public function multiply(string $leftOperand, string $rightOperand, int $precision = 0): string
67 65
     {
68
-        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) * intval($rightOperand)) :
69
-            round($leftOperand * $rightOperand, ($precision ?? 0), $this->roundingStrategy));
66
+        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) * intval($rightOperand)) : round($leftOperand * $rightOperand, ($precision ?? 0), $this->roundingStrategy));
70 67
     }
71 68
 
72 69
     /**
@@ -80,8 +77,7 @@  discard block
 block discarded – undo
80 77
      */
81 78
     public function divide(string $leftOperand, string $rightOperand, int $precision = 0): string
82 79
     {
83
-        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) / intval($rightOperand)) :
84
-            round($leftOperand / $rightOperand, $precision, $this->roundingStrategy));
80
+        return (string) ($this->isIntOperation($precision) ? (intval($leftOperand) / intval($rightOperand)) : round($leftOperand / $rightOperand, $precision, $this->roundingStrategy));
85 81
     }
86 82
 
87 83
     /**
@@ -192,7 +188,7 @@  discard block
 block discarded – undo
192 188
             return $this->gamma((string) $operand);
193 189
         }
194 190
 
195
-        $factorial = function (string $num) use (&$factorial) {
191
+        $factorial = function(string $num) use (&$factorial) {
196 192
             if ($num < 2) {
197 193
                 return 1;
198 194
             }
@@ -213,7 +209,7 @@  discard block
 block discarded – undo
213 209
      */
214 210
     public function gcd(string $leftOperand, string $rightOperand): string
215 211
     {
216
-        $gcd = function (string $a, string $b) use (&$gcd) {
212
+        $gcd = function(string $a, string $b) use (&$gcd) {
217 213
             return $b ? $gcd($b, strval($a % $b)) : $a;
218 214
         };
219 215
 
@@ -251,7 +247,7 @@  discard block
 block discarded – undo
251 247
     public function nextPrime(string $operand): string
252 248
     {
253 249
         $operand = (intval($operand) + 1);
254
-        for ($i = $operand;; ++$i) {
250
+        for ($i = $operand; ; ++$i) {
255 251
             if ($this->isPrime(strval($i))) {
256 252
                 break;
257 253
             }
Please login to merge, or discard this patch.
Math/AbstractMathAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
      */
134 134
     protected function getOperationType(string $a, string $b = null): string
135 135
     {
136
-        $getType = function ($v, $previousType = null) {
136
+        $getType = function($v, $previousType = null) {
137 137
             $previousType = $previousType ?? self::TYPE_INT;
138 138
 
139 139
             return (strpos($v, '.') !== false) ? self::TYPE_FLOAT : $previousType;
Please login to merge, or discard this patch.
Type/Collection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Tdn\PhpTypes\Type;
6 6
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function __construct(array $elements = array(), string $type = null)
47 47
     {
48 48
         $this->type = $type;
49
-        $this->elements = array_map(function ($element) {
49
+        $this->elements = array_map(function($element) {
50 50
             return $this->getRealValue($element);
51 51
         }, $elements);
52 52
     }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
      */
381 381
     public function unique()
382 382
     {
383
-        $closure = function ($key, $value) {
383
+        $closure = function($key, $value) {
384 384
             return is_string($value);
385 385
         };
386 386
 
Please login to merge, or discard this patch.