Releases: cloudcreativity/ddd-modules
Releases · cloudcreativity/ddd-modules
v5.1.0
What's Changed
- Feature: support PSR container in all specific container classes and add auto-wiring by @lindyhopchris in #31
- Feature: add UUID v4 and v7 specific identifier classes.
Full Changelog: v5.0.0...v5.1.0
v5.0.0
What's Changed
- Feature: add various breaking improvements for next major release by @lindyhopchris in #28
- Feature: add new helper methods to list of errors by @lindyhopchris in #29
- Feature: add PHP 8.5 to Github action tests by @lindyhopchris in #30
Full Changelog: v4.1.0...v5.0.0
v5.0.0-rc.4
What's Changed
Added
- The following fake classes now all implement array access to access captured items by index, plus can now be iterated over:
Testing\FakeDomainEventDispatcherTesting\FakeExceptionReporterTesting\FakeOutboundEventPublisherTesting\FakeQueue
Full Changelog: v5.0.0-rc.3...v5.0.0-rc.4
v5.0.0-rc.3
What's Changed
Added
- BREAKING Command and query validators can now return early on the first validation failure, by marking the validator with the
stopOnFirstFailure()method. This is technically a breaking change as the method was added to the validator interface; however, if you are using theValidatorclass provided by this package, it now implements this method. - Middleware that extend
ValidateCommandandValidateQuerycan mark themselves as stopping on the first failure by implementing theBailinterface, or overloading thestopOnFirstFailure()method to returntrue.
Full Changelog: v5.0.0-rc.2...v5.0.0-rc.3
v5.0.0-rc.2
What's Changed
Added
- Added a static
tryFrom()method to theIntegerId,StringIdandUuididentifier classes. This method returnsnullif the value provided cannot be cast to the identifier type. - The static
from()method on all the identifier classes now acceptsnullbut throws in this scenario. This allows it to be used where the value you are casting is possibly null. - New methods on the
ListOfErrorsinterface:find()to find the first matching error.sole()to get the first error, but only if exactly one error exists.any()to determine if any of the errors match.every()to determine if every error matches.filter()to get a new list containing only matching errors.
- The
FailedResultExceptionnow has a message when the result has an error code but no error message. - The
FakeExceptionReporternow hasnone()andexpect()helper methods, to prevent exceptions from being swallowed in tests. - BREAKING: Changes to the result interface to support the following features. Although technically breaking, this will not affect the majority of implementations are the concrete result class provided by this package has been updated.
- Can now pass a default value to the
Result::error()method. This default value can either be a string or a closure that receives the error code. (Errors always have codes if they do not have messages.) - Added
Result::code()method to get the first error code in the result's errors.
- Can now pass a default value to the
Deprecated
- The
ListOfErrors::contains()method is deprecated and will be removed in 6.0. Use the newany()method instead. - Calling the
ListOfErrors::first()method with arguments is deprecated and will be removed in 6.0. Use the newfind()method instead.
Full Changelog: v5.0.0-rc.1...v5.0.0-rc.2
v5.0.0-rc.1
What's Changed
Added
- BREAKING: The
Identifierinterface now has anany()method that returnstrueif any of the given identifiers match the identifier. If you have implemented any custom identifiers, you can add theIsIdentifiertrait to implement this new method. - BREAKING: Add
message()andmessages()helper methods to theErrorListinterface. Although technically breaking, this will not affect most implementations as the concrete error list class provided this package has been updated.
Full Changelog: v4.1.0...v5.0.0-rc.1
v4.1.0
What's Changed
Added
- Log context for objects that have date time properties will now convert those properties to strings.
- Log context for objects that have date time zones will now convert the time zone to its name.
Full Changelog: v4.0.0...v4.1.0
v4.0.0
What's Changed
Although this release contains breaking changes, most implementations should be able to upgrade without making any changes.
Added
- BREAKING: Added
code()method to theListOfErrorsinterface. This returns the first error code in the list, ornullif there are no error codes.
Changed
- BREAKING: The constructor argument order for the
Errorclass has changed. The new order iscode,message,key. Previously it waskey,message,codebecause code was added later. However, in most instancescodeis the most important property as it is used to programmatically detect specific error scenarios. This hopefully will not be breaking, as the docs specified that named arguments should be used when constructing error objects. - BREAKING The error and error list interfaces now accept
UnitEnuminstead ofBackedEnumfor error codes. Although technically breaking, this will only affect your implementation if you have implemented these interfaces. All concrete classes provided by this package have been updated. - BREAKING: The key of an error can now be an enum - previously only strings were accepted. This is only breaking if you have implemented the interface yourself.
- Updated
KeyedSetOfErrorsto handle error keys now being strings or enums. - BREAKING: The
Guid::make()method will now convert a string that is a UUID to a UUID GUID. Previously it would use a string id. - BREAKING: Updated the
GuidTypeMapclass so that it now supports enum aliases, enum types, and UUID identifiers. This means thetype()method now returns a string or enum, whereas previously it returned just a string. - Object log context now casts Ramsey UUIDs and enums to strings.
Removed
- Package no longer supports PHP 8.1. The minimum supported version is now PHP 8.2.
- BREAKING: Removed the
Guid::type()method - useenum_value($guid->type)orenum_string($guid->type)instead. - Removed the following classes that were deprecated in 3.4:
LazyListOfGuidsLazyListOfIdentifiersLazyListOfIntegerIdsLazyListOfStringIdsLazyListOfUuidsListOfIdentifiers
Full Changelog: v3.4.0...v4.0.0
v3.4.0
What's Changed
Deprecated
- All identifier list classes are deprecated and will be removed in 4.0. These were not documented and are being removed as they contain very limited functionality. Implementations can ship their own identifier list classes depending on their unique needs. The classes deprecated are:
LazyListOfGuidsLazyListOfIdentifiersLazyListOfIntegerIdsLazyListOfStringIdsLazyListOfUuidsListOfIdentifiers
Full Changelog: v3.3.1...v3.4.0
v3.3.1
What's Changed
Fixed
- Ensure that the
Resultclass uses@template-covariantfor its result value. This now matches the result interface, which already used template covariant.
Full Changelog: v3.3.0...v3.3.1