Skip to content

Releases: cloudcreativity/php-ddd-modules

Move result object to toolkit

29 Nov 19:37

Choose a tag to compare

Upgrading

composer require cloudcreativity/ddd-modules

Changelog

Changed

  • BREAKING: moved the Bus\Results namespace to Toolkit\Result. As part of this move, the interfaces and classes in
    this namespace no longer implement the log ContextProviderInterface, as this is an infrastructure dependency.
    Instead, the new Infrastructure\Log\ObjectContext and Infrastructure\Log\ResultContext class can be used to create
    context for either a result or an object.
  • All constructor arguments for the Toolkit\Result\Error object are now optional. This allows named arguments to be
    used when creating an error object.
  • The Toolkit\Result\Error object can now accept only a code, previously it had to have a message.
  • The following interfaces no longer extend the log ContextProviderInterface. Instead classes only need to implement
    that log interface if they need to customise how that class is logged.
    • Bus\MessageInterface
    • Infrastructure\Queue\QueueableInterface

Error improvements and other simplifications

22 Nov 19:38

Choose a tag to compare

Upgrading

composer require cloudcreativity/ddd-modules

Changelog

Added

  • The command and query validators now allow rules to return null to indicate no errors.
  • The following dispatchers now accept pipeline builder factories or pipeline containers into their constructor. This
    simplifies creating them, as in most cases a pipeline container can be provided from a dependency helper.
    • CommandDispatcher
    • QueryDispatcher
    • DomainEventDispatching\Dispatcher
    • Queue

Changed

  • BREAKING: changed the ErrorIterableInterface to ListOfErrorsInterface. Result objects now only accept list of
    errors. The KeyedSetOfErrors class can be used to convert a list into a keyed set if needed. This helps simplify
    the error handling logic, which was overly complex by having a generic error iterable interface that could either be
    a list or a keyed set.
  • BREAKING: The error interface no longer extends Stringable. Use $error->message() instead, or compose a string
    from multiple properties of the error object.
  • BREAKING: The code on an error object is now type-hinted as a BackedEnum or null - previously it was mixed.
    Error codes should be from a defined list, therefore an enum is the correctly defined type.
  • BREAKING: The PipelineBuilderFactory::cast() method has been renamed make().

Removed

  • BREAKING: removed the IterableInterface as there is no need for a list and a keyed set to inherit from the same
    interface.

Initial release

18 Nov 20:24

Choose a tag to compare

Changelog

Initial release of DDD Modules.