Skip to content

Extension points

tilttek/advent-calendar
PointWhat an application givesWhere
Contract\OpeningStoreThe storage of openings, in place of the store in memoryWriting a store
Psr\EventDispatcher\EventDispatcherInterfaceThe dispatcher BoxOpened goes through, to the listener that grants the surprise and may start a celebrationOpening boxes
Psr\Clock\ClockInterfaceThe clock the days are read from: the system's in production, a fixed one in testsTesting

The calendars are values the application builds with Calendar::of(); their surprises are references the application resolves. Every point is passed to the constructor of AdventCalendar, which keeps no state of its own between two calls.

The public types and the store contract are stable within a minor version of 0.x; a change to them comes with a new minor version and a line in the changelog.