Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function estimatePeriodEndAt(Recurrence $recurrence) |
||
18 | { |
||
19 | 1 | $periodEndAt = $recurrence->getPeriodEndAt(); |
|
20 | |||
21 | 1 | if ($recurrence->hasCount()) { |
|
22 | 1 | $periodEndAt = clone $recurrence->getPeriodStartAt(); |
|
23 | 1 | $periodEndAt->modify(str_replace('1', ($recurrence->getCount()*$recurrence->getInterval()), $recurrence->getFrequency()->convertToDateTimeFormat())); |
|
24 | } |
||
25 | |||
26 | 1 | return $periodEndAt; |
|
27 | } |
||
35 |