From 8762bc0bd8964ce8921b18f7a2fdd6427f2611e4 Mon Sep 17 00:00:00 2001 From: Julien Mercier-Rojas Date: Thu, 18 Jun 2020 11:51:05 +0200 Subject: [PATCH 1/3] Update readme --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 6fd114b..b07e900 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,33 @@ List of interfaces use as contract in other packages or DD projects This contract include some strong typings, and psalm validation. +## Main contracts + +### Core + +- `CommandDispatcher`: Define all contract for the **command bus** implementation with `Command`, `CommandHandler` and `CommandResponse`. + +### Domain + +- `Dto`: main **Dto** contract (empty for now, used to define typings) +- `Entity`: main **Entity** contract (empty for now, used to define typings) + - `DomainEventAwareInterface`: Define how entities handle Events, and for `Event` type +- `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 template](https://psalm.dev/docs/annotating_code/templated_annotations/) documentation for more info. +- `Equality`: define `equal`, required for Identity, but can be also use for entities and value objects. + +### Infrastructure +- `Exception`: Define basics Infrastructure exceptions (with forced immutability) +- `System`: + - `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: - [psalm template](https://psalm.dev/docs/annotating_code/templated_annotations/) - [psalm immutable](https://psalm.dev/articles/immutability-and-beyond) From ac1adfb8cd3f7727ad4f2cd104130c4fe8afac6a Mon Sep 17 00:00:00 2001 From: Julien Mercier-Rojas Date: Thu, 18 Jun 2020 12:03:20 +0200 Subject: [PATCH 2/3] Update readme with links --- README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b07e900..5625f0c 100644 --- a/README.md +++ b/README.md @@ -4,32 +4,33 @@ List of interfaces use as contract in other packages or DD projects -This contract include some strong typings, and psalm validation. +This contract includes some strong typings, object relation and psalm validation. + +Require **`php >= 7.2.*`** ## Main contracts ### Core -- `CommandDispatcher`: Define all contract for the **command bus** implementation with `Command`, `CommandHandler` and `CommandResponse`. +- **[CommandDispatcher](src/Core/CommandDispatcher/)**: Define all contract for the **command bus** implementation with `Command`, `CommandHandler` and `CommandResponse`. ### Domain -- `Dto`: main **Dto** contract (empty for now, used to define typings) -- `Entity`: main **Entity** contract (empty for now, used to define typings) - - `DomainEventAwareInterface`: Define how entities handle Events, and for `Event` type -- `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 template](https://psalm.dev/docs/annotating_code/templated_annotations/) documentation for more info. -- `Equality`: define `equal`, required for Identity, but can be also use for entities and value objects. +- **[Dto](src/Domain/Dto/Dto.php)**: main **Dto** contract (empty for now, used to define typings) +- **[Entity](src/Domain/Entity/Entity.php): main **Entity** contract (empty for now, used to define typings) + - **[DomainEventAwareInterface](src/Domain/Entity/DomainEventAwareInterface.php)**: Define how entities handle Events, and for `Event` type ([Trait](src/Domain/Entity/DomainEventAwareTrait.php) also available) +- **[Event](src/Domain/Event/Event.php)**: **Event** contract, force immutability, used by `CommandResponse`, `Entity` (EventAware) and `CommandBus` +- **[Exception](src/Domain/Exception/)**: Define a collection of Domain exceptions, all immutable +- **[Identity](src/Domain/Identity/Identity.php)**: Main contract for entity's **Identities** with exceptions, forced immutability and `Equality` interface +- **[ValueObject](src/Domain/ValueObject/ValueObject.php)**: force immutability on ValueObject, implements `toScalar` and `__toString` methods. See[psalm template](https://psalm.dev/docs/annotating_code/templated_annotations/) documentation for more info. +- **[Equality](src/Domain/Equality.php)**: 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) -- `System`: - - `Clock`: Define clock contract to return the current time as a mockable service +- **[Exception](src/Infrastructure/Exception/)**: Define basics Infrastructure exceptions (with forced immutability) +- **[Clock](src/Infrastructure/System/Clock.php)**: Define clock contract to return the current time as a mockable service ### Presentation -- `Exception`: Define basics Presentation exceptions (with forced immutability) +- **[Exception](src/Presentation/Exception/)**: Define basics Presentation exceptions (with forced immutability) ## Resources From 8dd2752738abf6398b2320d54fd0470ae2b7191c Mon Sep 17 00:00:00 2001 From: Julien Mercier-Rojas Date: Thu, 18 Jun 2020 12:10:30 +0200 Subject: [PATCH 3/3] Fix some typos --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5625f0c..e8ae719 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,20 @@ Require **`php >= 7.2.*`** ### Core -- **[CommandDispatcher](src/Core/CommandDispatcher/)**: Define all contract for the **command bus** implementation with `Command`, `CommandHandler` and `CommandResponse`. +- **[CommandDispatcher](src/Core/CommandDispatcher/)**: Define all contract for the **command bus** implementation with + - **[Command](src/Core/CommandDispatcher/Command/Command.php)** + - **[CommandHandler](src/Core/CommandDispatcher/CommandHandler/CommandHandler.php)** + - **[CommandResponse](src/Core/CommandDispatcher/CommandResponse/CommandResponse.php)** ### Domain - **[Dto](src/Domain/Dto/Dto.php)**: main **Dto** contract (empty for now, used to define typings) -- **[Entity](src/Domain/Entity/Entity.php): main **Entity** contract (empty for now, used to define typings) +- **[Entity](src/Domain/Entity/Entity.php)**: main **Entity** contract (empty for now, used to define typings) - **[DomainEventAwareInterface](src/Domain/Entity/DomainEventAwareInterface.php)**: Define how entities handle Events, and for `Event` type ([Trait](src/Domain/Entity/DomainEventAwareTrait.php) also available) - **[Event](src/Domain/Event/Event.php)**: **Event** contract, force immutability, used by `CommandResponse`, `Entity` (EventAware) and `CommandBus` - **[Exception](src/Domain/Exception/)**: Define a collection of Domain exceptions, all immutable - **[Identity](src/Domain/Identity/Identity.php)**: Main contract for entity's **Identities** with exceptions, forced immutability and `Equality` interface -- **[ValueObject](src/Domain/ValueObject/ValueObject.php)**: force immutability on ValueObject, implements `toScalar` and `__toString` methods. See[psalm template](https://psalm.dev/docs/annotating_code/templated_annotations/) documentation for more info. +- **[ValueObject](src/Domain/ValueObject/ValueObject.php)**: force immutability on ValueObject, implements `toScalar` and `__toString` methods. See [psalm templating](https://psalm.dev/docs/annotating_code/templated_annotations/) documentation for more info. - **[Equality](src/Domain/Equality.php)**: define `equal` method, required for Identity, but can be also use for entities and value objects. ### Infrastructure