Skip to content

Extension points

phil/opening-hours

The library is plain PHP: it declares no service and no port, and its classes are final. What an application chooses goes through arguments.

PointHow
The time zone of a placeThe $timezone of OpeningHours::of(): every question — open now, next opening — is answered in it, whatever zone the moment asked about is in
Holidays and closuresThe $specials of OpeningHours::of(): SpecialHours for a day or a period, computed by the application from its own calendar
Where hours are keptOpeningHoursArray::from() gives an array for one JSON column, OpeningHoursArray::to() reads it back
What people typeHoursText reads and writes the text form; a form of another shape builds DayHours and TimeRange itself
Structured dataOpeningHoursSchema::of() gives schema.org openingHoursSpecification; the application puts it in its JSON-LD
Catching the library's errorsEvery exception implements Phil\OpeningHours\Exception\OpeningHoursException

Day names and the layout of a table of hours are the application's: groups() gives the runs of days with the same hours, and the application writes them in its language.