Period::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * @author: Vova Lando <[email protected]>
5
 * @package: LoanPaymentsCalculator
6
 * @subpackage:
7
 * @created: 14/06/2017 16:14
8
 */
9
namespace cog\LoanPaymentsCalculator\Period;
10
11
/**
12
 * Class Period
13
 */
14
class Period
15
{
16
    /**
17
     * @var \DateTime
18
     */
19
    public $startDate;
20
21
    /**
22
     * @var \DateTime
23
     */
24
    public $endDate;
25
26
    /**
27
     * @var int
28
     */
29
    public $daysLength;
30
31
    /**
32
     * Period constructor.
33
     *
34
     * @param \DateTime $startDate
35
     * @param \DateTime $endDate
36
     */
37 6
    public function __construct(\DateTime $startDate, \DateTime $endDate)
38
    {
39 6
        $this->startDate = $startDate;
40 6
        $this->endDate = $endDate;
41 6
        $this->daysLength = $startDate->diff($endDate)->days;
42 6
    }
43
}
44