jeckel-lab/contract

Contract / Interfaces used by other packages and DDD projects

v2.0.0 2021-07-06 09:45 UTC

This package is auto-updated.

Last update: 2021-10-06 10:28:01 UTC


README

Build Status Latest Stable Version Total Downloads

Jeckel-Lab Contract

List of interfaces use as contract in other packages or DD projects

This contract includes some strong typings, object relation and psalm validation.

Require php >= 7.2.* and php >= 8.0

Release name Branch name Php Version
1.x release/1.X php >= 7.2 & php >= 8.0
2.x master php >= 8.0

Main contracts

Core

Domain

  • Dto: main Dto contract (empty for now, used to define typings)
  • Entity: main Entity contract (empty for now, used to define typings)
  • Event: Event contract, force immutability, used by CommandResponse, Entity (EventAware) and CommandBus
  • Exception: Define a collection of Domain exceptions, all immutable
  • Identity: Main contract for entity's Identities with exceptions, forced immutability and Equality interface
  • ValueObject: force immutability on ValueObject, implements toScalar and __toString methods. See psalm templating documentation for more info.
  • Equality: define equal method, required for Identity, but can be also use for entities and value objects.

Infrastructure

  • Exception: Define basics Infrastructure exceptions (with forced immutability)
  • Clock: Define clock contract to return the current time as a mockable service

Presentation

  • Exception: Define basics Presentation exceptions (with forced immutability)

Resources

Please also read some Psalm documentation: