Payment   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 116
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 11
lcom 0
cbo 0
dl 0
loc 116
ccs 20
cts 28
cp 0.7143
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPeriod() 0 4 1
A setPeriod() 0 4 1
A getPrincipal() 0 4 1
A setPrincipal() 0 4 1
A getInterest() 0 4 1
A setInterest() 0 4 1
A getFees() 0 4 1
A setFees() 0 4 1
A getPrincipalBalanceLeft() 0 4 1
A setPrincipalBalanceLeft() 0 4 1
1
<?php
2
/**
3
 * @author: Vova Lando <[email protected]>
4
 * @package: LoanPaymentsCalculator
5
 * @subpackage: Payment
6
 * @created: 05/09/2017 10:55
7
 */
8
9
namespace cog\LoanPaymentsCalculator\Payment;
10
11
12
use cog\LoanPaymentsCalculator\Period\Period;
13
14
class Payment
15
{
16
    /**
17
     * @var Period
18
     */
19
    private $period;
20
21
    /**
22
     * @var float
23
     */
24
    private $principal;
25
26
    /**
27
     * @var float
28
     */
29
    private $interest;
30
31
    /**
32
     * @var $fees
33
     */
34
    private $fees;
35
36
    /**
37
     * @var float
38
     */
39
    private $principalBalanceLeft;
40
41
    /**
42
     * Payment constructor.
43
     * @param Period $period
44
     */
45 4
    public function __construct(Period $period)
46
    {
47 4
        $this->period = $period;
48 4
    }
49
50
    /**
51
     * @return Period
52
     */
53 4
    public function getPeriod()
54
    {
55 4
        return $this->period;
56
    }
57
58
    /**
59
     * @param Period $period
60
     */
61
    public function setPeriod($period)
62
    {
63
        $this->period = $period;
64
    }
65
66
    /**
67
     * @return float
68
     */
69 4
    public function getPrincipal()
70
    {
71 4
        return $this->principal;
72
    }
73
74
    /**
75
     * @param float $principal
76
     */
77 4
    public function setPrincipal($principal)
78
    {
79 4
        $this->principal = $principal;
80 4
    }
81
82
    /**
83
     * @return float
84
     */
85 4
    public function getInterest()
86
    {
87 4
        return $this->interest;
88
    }
89
90
    /**
91
     * @param float $interest
92
     */
93 4
    public function setInterest($interest)
94
    {
95 4
        $this->interest = $interest;
96 4
    }
97
98
    /**
99
     * @return mixed
100
     */
101
    public function getFees()
102
    {
103
        return $this->fees;
104
    }
105
106
    /**
107
     * @param mixed $fees
108
     */
109
    public function setFees($fees)
110
    {
111
        $this->fees = $fees;
112
    }
113
114
    /**
115
     * @return float
116
     */
117 4
    public function getPrincipalBalanceLeft()
118
    {
119 4
        return $this->principalBalanceLeft;
120
    }
121
122
    /**
123
     * @param float $principalBalanceLeft
124
     */
125 4
    public function setPrincipalBalanceLeft($principalBalanceLeft)
126
    {
127 4
        $this->principalBalanceLeft = $principalBalanceLeft;
128
    }
129
}