Releases: cloudcreativity/php-ddd-modules
Releases · cloudcreativity/php-ddd-modules
v2.0.0-rc.1
What's Changed
This is a large refactoring, as we move to a hexagonal architecture. For a full discussion of this and how to upgrade, refer to the Upgrade Guide.
Additionally, there is the changelog.
Full Changelog: v1.2.0...v2.0.0-rc.1
Status
Although this is marked as a pre-release, it is considered stable enough to use. We only plan bug fixes - there are no plans for additional refactoring.
v1.2.0
Changelog
Added
- New integration event middleware:
NotifyInUnitOfWorkfor notifiers that need to be executed in a unit of work. Note that the documentation for Integration Events incorrectly showed theExecuteInUnitOfWorkcommand middleware being used.SetupBeforeEventfor doing setup work before an integration event is published or notified, and optionally teardown work after.TeardownAfterEventfor doing teardown work after an integration event is published or notified.LogInboundEventfor logging that an integration event is being received.LogOutboundEventfor logging that an integration event is being published.
Deprecated
- The following integration event middleware are deprecated and will be removed in 2.0:
LogInboundIntegrationEvent: useLogInboundEventinstead.LogOutboundIntegrationEvent: useLogOutboundEventinstead.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
Changelog
Added
- Allow an outbound integration event handler to implement a
publish()method. Thehandle()method is still supported, butpublish()makes more sense to describe what the handler does with the event it has been given.
Fixed
- Added missing UUID 7 and 8 methods to the UUID factory interface.
- The
Result::error()method now correctly returns the first error message even if it is not on the first error in the list.
Full Changelog: v1.0.0...v1.1.0
v1.0.0
Changelog
Removed
- BREAKING The following deprecated interfaces have been removed:
Bus\CommandInterfaceuseToolkit\Messages\CommandInterfaceinstead.Bus\QueryInterfaceuseToolkit\Messages\QueryInterfaceinstead.Bus\DispatchThroughMiddlewareuseToolkit\Messages\DispatchThroughMiddlewareinstead.Infrastructure\Log\ContextProviderInterfaceuseToolkit\Loggable\ContextProviderInterfaceinstead.
What's Changed
- Feature: final changes for the 1.0 release by @lindyhopchris in #5
Full Changelog: v1.0.0-rc.2...v1.0.0
v1.0.0-rc.2
Changelog
Added
- New
FailedResultExceptionfor throw result objects that have not succeeded.
Changed
- BREAKING: The
UnitOfWorkAwareDispatchernow queues deferred events to be dispatched before the unit of work commits. Previously it queued them for after the commit. This changes allows communication between different domain entities to occur within the unit of work, which is the correct pattern. For example, if an entity or aggregate root needs to be updated as a result of another entity or aggregate dispatching a domain event. It also allows an outbox pattern to be used for the publishing of integration events. This is a breaking change because it changes the order in which events and listeners are executed. Listeners that need to be dispatched after the commit should now implement theDispatchAfterCommitinterface.
Fixed
- The
ExecuteInUnitOfWorkmiddleware now correctly prevents the unit of work committing if the inner handler returns a failed result. Previously the unit of work would have committed, which was incorrect for a failed result.
Full Changelog: v1.0.0-rc.1...v1.0.0-rc.2
v1.0.0-rc.1
Changelog
Added
- New event bus notifier implementation that was previously missing. This completes the event bus implementation.
- New message interfaces (command, query, integration event) added to the toolkit.
- New loggable context provider interface added to the toolkit.
- Module basename now supports namespaces where an application only has a single bounded context.
Changed
- BREAKING Moved the following interfaces to the
Toolkit\Messagesnamespace:MessageInterfaceIntegrationEventInterface
- BREAKING Interfaces that type-hinted
Bus\CommandInterface,Bus\QueryInterfaceorBus\MessageInterfacenow type-hint the new interfaces in theToolkit\Messagesnamespace. - BREAKING Moved the
EventBusimplementation fromInfrastructure\EventBustoEventBus. In Deptrac, this namespace is now part of the Application Bus layer. Renamed the publisher handler and publisher handler containers to integration event handler and container - so that they can be used for both the publisher and notifier implementations. - BREAKING Removed the
EventBus\PublishThroughMiddlewareinterface. Use theToolkit\Messages\DispatchThroughMiddlewareinterface instead.
Removed
- BREAKING removed the
deptrac-layers.yamlfile, in favour of applications including the classes in their own Deptrac configuration.
Full Changelog: v0.6.1...v1.0.0-rc.1
v0.6.1
Changelog
Fixed
- Removed
finalfrom theDeferredDispatcherandUnitOfWorkAwareDispatcherclasses so that they can be extended.
Event bus and domain event dispatcher improvements
Upgrading
composer require cloudcreativity/ddd-modulesChangelog
Added
- New
DeferredDispatcherclass for dispatching domain events when not using a unit of work. - New UUID factory interface and class, that wraps the
ramsey/uuidfactory to return UUID identifiers. - GUIDs that wrap UUIDs can now be created via the static
Guid::fromUuid()method. - New
SetupBeforeDispatchandTearDownAfterDispatchbus middleware, that can be used either to setup (and optionally tear down) application state around the dispatching of a message, or to just do tear down work. - The
EventBusnamespace now has a working implementation for publishing integration events. - Can now provide a closure to the
ListOfErrorsInterface::first()method to find the first matching error. - Added the following methods to the
ListOfErrorsInterface:contains()- determines whether the list contains a matching error.codes()- returns an array containing the unique error codes in the list.
- Added an
ErrorInterface::is()method to determine whether an error matches a given code.
Changed
- BREAKING - renamed the domain event
Dispatcherclass toUnitOfWorkAwareDispatcher. - BREAKING - removed the
IntegrationEventsnamespace and moved to theInfrastructure\EventBusnamespace. - BREAKING - the
IntegrationEventInterfacenow expects the UUID to be an identifier UUID, not a Ramsey UUID. - The UUID factory from the
ramsey/uuidpackage is now used when creating new UUID identifiers.
Fixed
- The unit of work manager now correctly handles re-attempts so that deferred events are not dispatched multiple times.
PHPStan and iterable improvements
Upgrading
composer require cloudcreativity/ddd-modulesChangelog
Added
- New
LazyListOfIdentifiersclass for lazy iteration over a list of identifiers. - Log context for a result now includes the value if it is a scalar value (string, integer, float, or boolean).
Changed
- BREAKING: add the
$stackproperty to theListTraitandKeyedSetTraittraits, and use generics to indicate the value they hold. This is breaking because it will cause PHPStan to fail for existing classes the use these traits. - BREAKING: renamed the
LazyIteratorTraittoLazyListTraitand defined its values using generics.
Result fixes and improvements
Upgrading
composer require cloudcreativity/ddd-modulesChangelog
Added
- Log context for a result now includes the value if it implements
ContextProviderInterfaceorIdentifierInterface. - BREAKING: added a
safemethod to theResultInterface, that gives access to the result value without throwing an
exception if the result is an error.
Fixed
- Remove
EntityTrait::getId()nullable return type as it is always set. - Fix generic return type on
Result::ok()method.