'Täglich', self::WEEKLY => 'Wöchentlich', self::TWO_WEEKLY => 'Alle zwei Wochen', self::FOUR_WEEKLY => 'Alle vier Wochen', }; } /** Days between two occurrences. */ public function intervalDays(): int { return match ($this) { self::DAILY => 1, self::WEEKLY => 7, self::TWO_WEEKLY => 14, self::FOUR_WEEKLY => 28, }; } /** Whether the rule lands on the same weekday every time, i.e. whether naming it adds anything. */ public function keepsWeekday(): bool { return 0 === $this->intervalDays() % 7; } }