Completed
Push — master ( b9769b...30fce5 )
by Tobias
24:02
created

Calculator::withEqualPayments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Nyholm\EffectiveInterest;
4
5
/**
6
 * @author Tobias Nyholm <[email protected]>
7
 */
8
class Calculator
9
{
10
    /**
11
     * Get the interest when you know all the payments and their dates. Use this function when you have
12
     * administration fees at the first payment and/or when payments are irregular.
13
     *
14
     * @param int    $principal
15
     * @param string $startDate in format 'YYYY-mm-dd'
16
     * @param array  $payments  array with payment dates and values ['YYYY-mm-dd'=>int]
17
     * @param float  $guess     A guess what the interest may be. Between zero and one. Example 0.045
18
     *
19
     * @return float
20
     */
21
    public function withSpecifiedPayments(int $principal, string $startDate, array $payments, float $guess): float
0 ignored issues
show
Unused Code introduced by
The parameter $principal is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $startDate is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $payments is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $guess is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
    {
23
        return 0.045;
24
    }
25
26
    public function withEqualPayments()
27
    {
28
        // TODO implement NewtonRaphson call.
29
    }
30
}
31