Search by

adachsoft / recurrence-contracts

Arkadiusz Adach

Interfaces, value objects and data transfer objects for recurrence rules and occurrence calculation.

Package info

gitlab.com/a.adach/recurrence-contracts

Issues

pkg:composer/adachsoft/recurrence-contracts

Statistics

Installs: 24

Dependents: 1

Suggesters: 0

Stars: 0

v0.1.0 2026-11-22 09:19 UTC

This package is auto-updated.

Last update: 2026-11-22 08:19:53 UTC


README

A dependency-free PHP library of value objects and interfaces for defining recurrence rules and calculated occurrences. It provides the contracts for recurrence models, occurrence calculation, and rule serialization without imposing a storage or serialization format.

Features

  • Immutable recurrence rule and occurrence value objects.
  • Recurrence frequencies, local wall-clock times, weekday selectors, and end conditions.
  • Interfaces for occurrence calculators and rule normalizers, allowing application-specific implementations.

Requirements

  • PHP 8.3 or later.

Installation

composer require adachsoft/recurrence-contracts

Usage

Use the rule DTOs to represent recurrence data in your application. Implement OccurrenceCalculatorInterface to calculate occurrences and RecurrenceRuleNormalizerInterface with a RuleTypeNormalizerInterface implementation to normalize rules for your chosen persistence or transport format. This package defines these contracts but does not include calculator or normalizer implementations.

See the usage example for constructing rules.