Total Complexity | 2 |
Total Lines | 12 |
Duplicated Lines | 0 % |
Coverage | 60% |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
20 | class MonthPeriod extends Period |
||
21 | { |
||
22 | 5 | public function countPeriodsPassed(DateTimeImmutable $since, DateTimeImmutable $time): float |
|
23 | { |
||
24 | 5 | $diff = $time->diff($since); |
|
25 | |||
26 | 5 | return ($diff->m + $diff->y*12) / $this->value; |
|
27 | } |
||
28 | |||
29 | public function addTo(DateTimeImmutable $since): DateTimeImmutable |
||
32 | } |
||
33 | } |
||
34 |