• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tito10047 / php-calendar / 28423919883

30 Jun 2026 05:52AM UTC coverage: 83.159% (-0.002%) from 83.161%
28423919883

push

github

tito10047
feat: replace DayName week-start with WeekStart enum, clean modular arithmetic

Introduce WeekStart enum (Monday/Saturday/Sunday) to replace DayName as the
week-start parameter throughout the public API. CalendarType::getStartDate and
getEndDate are rewritten with pure modular arithmetic — no more PHP string
manipulation chains and no more bug where Monthly ignored $firstDay entirely.

WeekStart::lastDayIsoNumber() computes the last ISO weekday of a week using
(value + 5) % 7 + 1, which is exact and branch-free for all three cases.
DaysGeneratorInterface, Calendar, CalendarInterface, and CalendarConfig are
updated accordingly. Three new CalendarTypeTest cases cover Sunday and
Saturday starts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

25 of 26 new or added lines in 2 files covered. (96.15%)

637 of 766 relevant lines covered (83.16%)

7.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/Enum/WeekStart.php


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc