Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
23 | function getEasterMonday(Year $year) |
||
24 | { |
||
25 | 2 | $year = $year->toInt(); |
|
26 | 2 | $time = sprintf('%d-03-21', $year); |
|
27 | 2 | $base = new DateTimeImmutable($time); |
|
28 | 2 | $days = easter_days($year, CAL_EASTER_ALWAYS_GREGORIAN); |
|
29 | 2 | $intervalSpec = sprintf('P%dD', $days + 1); |
|
30 | 2 | $daysInterval = new DateInterval($intervalSpec); |
|
31 | |||
32 | 2 | return $base->add($daysInterval); |
|
33 | } |
||
34 | |||
39 |