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

tito10047 / php-calendar / 28463424993

30 Jun 2026 05:27PM UTC coverage: 83.543% (+3.4%) from 80.186%
28463424993

push

github

tito10047
feat: complete BYMONTHDAY per RFC 5545 — negative values + validation

Negative BYMONTHDAY values (RFC §3.3.10 allows -31 to -1):
- expandMonth() resolves dom < 0 as daysInMonth + dom + 1
  (-1 = last day, -2 = second-to-last, etc.)
- matchesByMonthDay() applies the same resolution so FREQ=DAILY
  filters correctly against month-relative positions

Validation (RFC §3.3.10: "MUST NOT be specified when FREQ=WEEKLY"):
- fromRrule() throws InvalidArgumentException on FREQ=WEEKLY;BYMONTHDAY=…
- onMonthDays() throws when called on a weekly rule

Input range guard (both fromRrule and onMonthDays):
- rejects 0 and any value outside -31..31

Tests added (10 new cases):
- last/third-from-last day via RRULE string
- negative value via builder (onMonthDays(-1))
- FREQ=DAILY;BYMONTHDAY=-1 filter path
- FREQ=WEEKLY + BYMONTHDAY throws (both parse and builder paths)
- boundary validation: 0, 32, -32
- round-trip serialisation of negative values (BYMONTHDAY=-1,15)

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

20 of 21 new or added lines in 1 file covered. (95.24%)

1 existing line in 1 file now uncovered.

731 of 875 relevant lines covered (83.54%)

7.26 hits per line

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

80.63
/src/Recurrence/RecurrenceRule.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