Skip to content

Releases: cloudcreativity/ddd-modules

v5.1.0

01 Jan 20:12

Choose a tag to compare

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

09 Dec 13:59

Choose a tag to compare

What's Changed

Full Changelog: v4.1.0...v5.0.0

v5.0.0-rc.4

29 Oct 15:48

Choose a tag to compare

v5.0.0-rc.4 Pre-release
Pre-release

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\FakeDomainEventDispatcher
    • Testing\FakeExceptionReporter
    • Testing\FakeOutboundEventPublisher
    • Testing\FakeQueue

Full Changelog: v5.0.0-rc.3...v5.0.0-rc.4

v5.0.0-rc.3

14 Oct 13:00

Choose a tag to compare

v5.0.0-rc.3 Pre-release
Pre-release

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 the Validator class provided by this package, it now implements this method.
  • Middleware that extend ValidateCommand and ValidateQuery can mark themselves as stopping on the first failure by implementing the Bail interface, or overloading the stopOnFirstFailure() method to return true.

Full Changelog: v5.0.0-rc.2...v5.0.0-rc.3

v5.0.0-rc.2

14 Oct 06:48

Choose a tag to compare

v5.0.0-rc.2 Pre-release
Pre-release

What's Changed

Added

  • Added a static tryFrom() method to the IntegerId, StringId and Uuid identifier classes. This method returns null if the value provided cannot be cast to the identifier type.
  • The static from() method on all the identifier classes now accepts null but throws in this scenario. This allows it to be used where the value you are casting is possibly null.
  • New methods on the ListOfErrors interface:
    • 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 FailedResultException now has a message when the result has an error code but no error message.
  • The FakeExceptionReporter now has none() and expect() 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.

Deprecated

  • The ListOfErrors::contains() method is deprecated and will be removed in 6.0. Use the new any() method instead.
  • Calling the ListOfErrors::first() method with arguments is deprecated and will be removed in 6.0. Use the new find() method instead.

Full Changelog: v5.0.0-rc.1...v5.0.0-rc.2

v5.0.0-rc.1

14 Oct 06:46

Choose a tag to compare

v5.0.0-rc.1 Pre-release
Pre-release

What's Changed

Added

  • BREAKING: The Identifier interface now has an any() method that returns true if any of the given identifiers match the identifier. If you have implemented any custom identifiers, you can add the IsIdentifier trait to implement this new method.
  • BREAKING: Add message() and messages() helper methods to the ErrorList interface. 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

03 Oct 12:55

Choose a tag to compare

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

12 Sep 11:08

Choose a tag to compare

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 the ListOfErrors interface. This returns the first error code in the list, or null if there are no error codes.

Changed

  • BREAKING: The constructor argument order for the Error class has changed. The new order is code, message, key. Previously it was key, message, code because code was added later. However, in most instances code is 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 UnitEnum instead of BackedEnum for 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 KeyedSetOfErrors to 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 GuidTypeMap class so that it now supports enum aliases, enum types, and UUID identifiers. This means the type() 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 - use enum_value($guid->type) or enum_string($guid->type) instead.
  • Removed the following classes that were deprecated in 3.4:
    • LazyListOfGuids
    • LazyListOfIdentifiers
    • LazyListOfIntegerIds
    • LazyListOfStringIds
    • LazyListOfUuids
    • ListOfIdentifiers

Full Changelog: v3.4.0...v4.0.0

v3.4.0

12 Sep 11:03

Choose a tag to compare

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:
    • LazyListOfGuids
    • LazyListOfIdentifiers
    • LazyListOfIntegerIds
    • LazyListOfStringIds
    • LazyListOfUuids
    • ListOfIdentifiers

Full Changelog: v3.3.1...v3.4.0

v3.3.1

10 Aug 16:55

Choose a tag to compare

What's Changed

Fixed

  • Ensure that the Result class uses @template-covariant for its result value. This now matches the result interface, which already used template covariant.

Full Changelog: v3.3.0...v3.3.1