Skip to content

Installation

tilttek/character-retirement
composer require tilttek/character-retirement

The package needs PHP 8.5 or later, and tilttek/character-sheet 0.1.

An application gives CharacterEndings:

  • a Contract\EndingStoreInterface that keeps the endings in its database;
  • the CharacterSheets service of tilttek/character-sheet, which reads and computes the sheets;
  • a Contract\EndingObserverInterface, to send its messages, or nothing.

The service keeps no state between calls, so one instance serves every request of a long-running worker.

The calls that date an ending or a return take the moment as a DateTimeImmutable: the application reads it from its clock, or takes the date the table gives.

Store\InMemoryEndingStore keeps the endings in memory, for tests.