Completed
Pull Request — master (#6)
by
unknown
02:56
created
src/Utils/MathFuncs.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -80,11 +80,11 @@
 block discarded – undo
80 80
             return (string)number_format((float)$roundedNumber, $precision);
81 81
         }
82 82
         
83
-         /**
84
-         * @param $roundedNumber
85
-         * @param $precision
86
-         * @return string
87
-         */
83
+            /**
84
+             * @param $roundedNumber
85
+             * @param $precision
86
+             * @return string
87
+             */
88 88
         public static function round_up($roundedNumber, $precision = 2) 
89 89
         {
90 90
             return (string)ceil((float)$roundedNumber * pow(10, $precision)) / pow(10, $precision);
Please login to merge, or discard this patch.
src/Calculators/DebtAmortizator.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -338,9 +338,9 @@
 block discarded – undo
338 338
             return $repayments;
339 339
         }
340 340
 				
341
-				 /**
342
-         * @return array
343
-         */
341
+                    /**
342
+                     * @return array
343
+                     */
344 344
         public function getDebtRepaymentsAsArraysRounded()
345 345
         {
346 346
             $repayments = array();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -347,10 +347,10 @@
 block discarded – undo
347 347
             $i = 1;
348 348
             $balance = $this->debtPrincipal;            
349 349
             foreach ($this->debtRepayments as $repayment) {
350
-                if($balance > $repayment->getTotalAmount()) {      
350
+                if ($balance > $repayment->getTotalAmount()) {      
351 351
                     $totalAmount = MathFuncs::roundUp($repayment->getTotalAmount(), 2);
352 352
                     $interestAmount = MathFuncs::round($repayment->getInterestAmount(), 2);
353
-                    $principalAmount = MathFuncs::round($totalAmount - $interestAmount, 2);
353
+                    $principalAmount = MathFuncs::round($totalAmount-$interestAmount, 2);
354 354
                 }
355 355
                 else {
356 356
                     $interestAmount = MathFuncs::round($repayment->getInterestAmount(), 2);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -351,8 +351,7 @@
 block discarded – undo
351 351
                     $totalAmount = MathFuncs::roundUp($repayment->getTotalAmount(), 2);
352 352
                     $interestAmount = MathFuncs::round($repayment->getInterestAmount(), 2);
353 353
                     $principalAmount = MathFuncs::round($totalAmount - $interestAmount, 2);
354
-                }
355
-                else {
354
+                } else {
356 355
                     $interestAmount = MathFuncs::round($repayment->getInterestAmount(), 2);
357 356
                     $totalAmount = MathFuncs::round(MathFuncs::add($balance, $interestAmount), 2);
358 357
                     $principalAmount = MathFuncs::round($balance, 2);
Please login to merge, or discard this patch.