Total Complexity | 4 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | class DayPeriod extends Period |
||
22 | { |
||
23 | public function countPeriodsPassed(DateTimeImmutable $since, DateTimeImmutable $time): float |
||
24 | { |
||
25 | $diff = $time->diff($since); |
||
26 | |||
27 | return $diff->format('%r%a') / $this->value; |
||
28 | } |
||
29 | |||
30 | public function addTo(DateTimeImmutable $since): DateTimeImmutable |
||
33 | } |
||
34 | |||
35 | public function __toString(): string |
||
40 |