Skip to content

V2: Architectural rewrite#309

Open
Nielsvanpach wants to merge 79 commits intomainfrom
v2
Open

V2: Architectural rewrite#309
Nielsvanpach wants to merge 79 commits intomainfrom
v2

Conversation

@Nielsvanpach
Copy link
Collaborator

@Nielsvanpach Nielsvanpach commented Feb 25, 2026

Summary

Major version rewrite focused on type safety, performance, and a cleaner architecture. Breaking changes are documented in UPGRADING.md.

For users

  • Improved supports for types of holidays: national, regional, observed, religious or bank
  • New API methods
  • get() and getInRange() now return Holiday[] value objects instead of plain arrays
  • Holidays::for() accepts a region parameter directly
  • Most countries now support any year (no more global 1970–2037 limit)
  • Requires PHP 8.4+

For contributors

  • All dates are CarbonImmutable throughout — no more implicit string parsing
  • Translation logic moved into the Country base class
  • HasRegions interface standardizes regional holidays
  • HasObservedHolidays trait replaces Observable with clearer method signatures
  • ResolvesCalendarDates trait deduplicates calendar logic
  • CountryRegistry replaces filesystem scanning

Performance

  • Country discovery via static registry instead of glob()
  • No per-holiday string-to-date parsing overhead

Links

  • UPGRADING.md — full migration guide
  • README.md — rewritten with comprehensive "Adding a new country" guide

Fix existing country holiday bugs
V2: Introduce Holiday value object and HolidayType enum
V2: Replace glob-based country discovery with static CountryRegistry
V2: Remove country/year override parameters from Holidays API
V2: Standardize regional holidays with HasRegions interface
@Nielsvanpach Nielsvanpach marked this pull request as ready for review February 26, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants