Completed
Push — master ( ba4a7f...9f49d7 )
by Tobias
02:17
created
src/Calculator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $dates[] = 1 + $startDate->diff(new \DateTime($date))->days;
43 43
         }
44 44
 
45
-        $fx = function ($x) use ($dates, $values) {
45
+        $fx = function($x) use ($dates, $values) {
46 46
             $sum = 0;
47 47
             foreach ($dates as $idx => $date) {
48 48
                 $sum += $values[$idx] * pow(1 + $x, ($dates[0] - $date) / 365);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             return $sum;
52 52
         };
53 53
 
54
-        $fdx = function ($x) use ($dates, $values) {
54
+        $fdx = function($x) use ($dates, $values) {
55 55
             $sum = 0;
56 56
             foreach ($dates as $idx => $date) {
57 57
                 $sum += (1 / 365) * ($dates[0] - $date) * $values[$idx] * pow(1 + $x, (($dates[0] - $date) / 365.0) - 1.0);
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function withEqualPayments(int $a, int $p, int $n, float $i): float
77 77
     {
78
-        $fx = function ($i) use ($a, $p, $n) {
78
+        $fx = function($i) use ($a, $p, $n) {
79 79
             return  $p - $p * pow(1 + $i, -1 * $n) - $i * $a;
80 80
         };
81 81
 
82
-        $fdx = function ($i) use ($a, $p, $n) {
82
+        $fdx = function($i) use ($a, $p, $n) {
83 83
             return  $n * $p * pow(1 + $i, -1 * $n - 1) - $a;
84 84
         };
85 85
 
Please login to merge, or discard this patch.