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