Changelog 1.6.0 — 25th of August 2023¶
A bundle is now available for Symfony applications, it will ease the integration and usage of the Valinor library in the framework. The documentation can be found in the CuyZ/Valinor-Bundle repository.
Note that the documentation has been updated to add information about the bundle as well as tips on how to integrate the library in other frameworks.
PHP 8.3 support
Better type parsing
The first layer of the type parser has been completely rewritten. The previous one would use regex to split a raw type in tokens, but that led to limitations — mostly concerning quoted strings — that are now fixed.
Although this change should not impact the end user, it is a major change in the library, and it is possible that some edge cases were not covered by tests. If that happens, please report any encountered issue on the repository.
Example of previous limitations, now solved:
More advanced array-key handling
It is now possible to use any string or integer as an array key. The following types are now accepted and will work properly with the mapper:
$mapper->map("array<'foo'|'bar', string>", ['foo' => 'foo']); $mapper->map('array<42|1337, string>', [42 => 'foo']); $mapper->map('array<positive-int, string>', [42 => 'foo']); $mapper->map('array<negative-int, string>', [-42 => 'foo']); $mapper->map('array<int<-42, 1337>, string>', [42 => 'foo']); $mapper->map('array<non-empty-string, string>', ['foo' => 'foo']); $mapper->map('array<class-string, string>', ['SomeClass' => 'foo']);
- Add support for PHP 8.3 (5c44f8)
- Allow any string or integer in array key (12af3e)
- Support microseconds in the Atom / RFC 3339 / ISO 8601 format (c25721)
- Correctly handle type inferring for method coming from interface (2657f8)
- Detect missing closing bracket after comma in shaped array type (2aa4b6)
- Handle class name collision while parsing types inside a class (044072)
- Handle invalid Intl formats with
- Improve cache warmup by creating required directories (a3341a)
- Load attributes lazily during runtime and cache access (3e7c63)
- Properly handle class/enum name in shaped array key (1964d4)