Releases: dereuromark/cakephp-dto
1.5.2
Fixes
- Allow int as float type fix for immutables by @jorisvaesen in #59
- Fixed empty arrayobject to array by @jorisvaesen in #60
Full Changelog: 1.5.1...1.5.2
1.5.1
Improvements
- Allow digits in DTO names
- Relax file names for DTO configs
1.5.0
Fixes
Serializable
Implementing Serializable interface is deprecated in PHP 8.1 without having the magic methods in place.
Those have now been added. They return associative arrays however and work differently than the explicit serialize()
call which returns a string.
Collections
Fixed duplication issue with using collections and name collisions in certain aliasing cases.
Note: This can be BC impacting if you use aliasing here, double-check this before upgrading
Example
<field name="labels" type="FilterElement[]"/>
<field name="brands" type="FilterElement[]"/>
Before, this was creating methods using the singular "FilterElement" instead of "Label" or "Brand".
This is now fixed.
1.4.0
Improvements
Allow custom DTO specification file finder class to be configured - using Configure key 'CakeDto.finder'
. Thx to @jorisvaesen for this contribution.
1.3.0
Improvements
- Added set*OrFail() wrapper to make it easier to have an early error system for invalid null setting.
CakePHP 4.3 checked/approved and CakePHP 4.2+ / PHP 7.3+ now.
1.2.4
Fixes
- Uses configured App namespace by default
1.2.3
Improvements
Stricter validation for collection type: type[]
instead of type
required
1.2.2
Fixes
Adjusted to allow for latest PHPStan strict rules.
1.2.1
Fixes
Small fix in builder.
1.2.0
Improvements
Stricter validation for field names and types.
- If a field name is not
camelBacked
- If setting through fromArray() contains not matching scalar types for immutable or any type for mutable objects
Default value object instantiation has been improved.
factory
XML attribute added in case the default constructor option is not sufficient for some edge cases.
The following should work out of the box for also string input (e.g. from API data):
<field name="created" type="\Cake\I18n\FrozenTime"/>
BC breaking impact
The config scalarTypeHints
has been renamed to scalarAndReturnTypes
since this is closer to what it stands for.
Since it defaults to true either way, this is a small BC break early in the 1.x release.
Please make sure you regenerate all DTOs after this upgrade!