| 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 |
||
| 9 | public function estimatePeriodEndAt(Recurrence $recurrence): ?\Datetime |
||
| 10 | { |
||
| 11 | 1 | $periodEndAt = $recurrence->getPeriodEndAt(); |
|
| 12 | |||
| 13 | 1 | if ($recurrence->hasCount()) { |
|
| 14 | 1 | $periodEndAt = clone $recurrence->getPeriodStartAt(); |
|
| 15 | 1 | $periodEndAt->modify(str_replace('1', ($recurrence->getCount()*$recurrence->getInterval()), $recurrence->getFrequency()->convertToDateTimeFormat())); |
|
| 16 | } |
||
| 17 | |||
| 18 | 1 | return $periodEndAt; |
|
| 19 | } |
||
| 26 |