Releases: cloudcreativity/php-ddd-modules
Releases · cloudcreativity/php-ddd-modules
Move result object to toolkit
Upgrading
composer require cloudcreativity/ddd-modulesChangelog
Changed
- BREAKING: moved the
Bus\Resultsnamespace toToolkit\Result. As part of this move, the interfaces and classes in
this namespace no longer implement the logContextProviderInterface, as this is an infrastructure dependency.
Instead, the newInfrastructure\Log\ObjectContextandInfrastructure\Log\ResultContextclass can be used to create
context for either a result or an object. - All constructor arguments for the
Toolkit\Result\Errorobject are now optional. This allows named arguments to be
used when creating an error object. - The
Toolkit\Result\Errorobject 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\MessageInterfaceInfrastructure\Queue\QueueableInterface
Error improvements and other simplifications
Upgrading
composer require cloudcreativity/ddd-modulesChangelog
Added
- The command and query validators now allow rules to return
nullto 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.CommandDispatcherQueryDispatcherDomainEventDispatching\DispatcherQueue
Changed
- BREAKING: changed the
ErrorIterableInterfacetoListOfErrorsInterface. Result objects now only accept list of
errors. TheKeyedSetOfErrorsclass 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
BackedEnumornull- previously it wasmixed.
Error codes should be from a defined list, therefore an enum is the correctly defined type. - BREAKING: The
PipelineBuilderFactory::cast()method has been renamedmake().
Removed
- BREAKING: removed the
IterableInterfaceas there is no need for a list and a keyed set to inherit from the same
interface.
Initial release
Changelog
Initial release of DDD Modules.