Releases: Articus/DataTransfer
v0.6.3
v0.6.2
Enhancements
Internal metadata caching code was reworked to support all current versions of psr/simple-cache - 1.0.1, 2.0 and 3.0.
Fixes
Now library respects PSR-16 semantic restriction for cached item keys:
The following characters are reserved for future extensions and MUST NOT be supported by implementing libraries:
{}()/\@:
and does not pass raw class FQN as key to psr/simple-cache implementation if you configured one for metadata caching.
0.6.1
v0.6
Enhancements
- minimal PHP version bump to 7.4 - it became too cumbersome to support 7.1 :(
laminas/laminas-servicemanageris no longer a direct dependency - now library usesarticus/plugin-managerfor plugin managers
Migration notes
- classes
Articus\DataTransfer\Strategy\PluginManagerandArticus\DataTransfer\Validator\PluginManagerwere removed, but their names are still used for configuration. So you may need to update type hints in your code and/or switch::classusages to new constants fromArticus\DataTransfer\Options. - class
Articus\DataTransfer\Strategy\Factory\PluginManagerwas removed - use eitherArticus\DataTransfer\Strategy\Factory\SimplePluginManagerorArticus\DataTransfer\Strategy\Factory\LaminasPluginManagerinstead. - class
Articus\DataTransfer\Validator\Factory\PluginManagerwas removed - use eitherArticus\DataTransfer\Validator\Factory\SimplePluginManagerorArticus\DataTransfer\Validator\Factory\LaminasPluginManagerinstead.
v0.5.3
v0.5.2
New features
Sometimes your typed data contains immutable objects that can be fully represented by their integer or string identifiers and the transfer might become a bit complex, especially if there are nested collections. New strategy Articus\DataTransfer\Strategy\Identifier and new validator Articus\DataTransfer\Validator\Identifier provide transparent and configurable mechanism to bulk load required immutable objects by their identifiers and allow to handle such situation naturally and efficiently.
v0.5.1
v0.5
New features
- new metadata provider for PHP 8 -
Articus\DataTransfer\MetadataProvider\PhpAttribute. It allows to declare metadata via class and property attributes. - new build-in highly configurable strategies to deal with complex values:
Articus\DataTransfer\Strategy\IdentifiableValue,Articus\DataTransfer\Strategy\IdentifiableValueList,Articus\DataTransfer\Strategy\IdentifiableValueMap.
Enhancements
- implementation for short strategy aliases Object and ObjectArray was updated to use
Articus\DataTransfer\Strategy\IdentifiableValueandArticus\DataTransfer\Strategy\IdentifiableValueList
Migration notes
Classes Articus\DataTransfer\Strategy\NoArgObject and Articus\DataTransfer\Strategy\NoArgObjectList were removed. If you use them directly consider switching to Articus\DataTransfer\Strategy\IdentifiableValue or Articus\DataTransfer\Strategy\IdentifiableValueList.
v0.4.1
Enhancements
- library can be used in PHP 8.0 projects - Laminas Service Manager finally got official support for it!
v0.4
New features
- strategies now control untyped data merge process before validation so custom hydration logic for your classes is no longer restricted by single instance of untyped data hydrator inside data transfer service
- migration from Zend to Laminas packages due to global brand change:
zendframework/zend-servicemanager->laminas/laminas-servicemanagerzendframework/zend-stdlib->laminas/laminas-stdlibzendframework/zend-validator->laminas/laminas-validator
- metadata caching mechanism overhaul:
- library no longer relies directly on
zendframework/zend-cache, you may use any implementation ofpsr/simple-cacheyou like - simple partial PSR-16 implementation optimized for metadata storage is provided out-of-the-box
- library no longer relies directly on
Migration notes
Sadly migration might be a bit cumbersome because you have to apply quite a lot small technical changes.
Update your custom strategies
Articus\DataTransfer\Strategy\StrategyInterface now requires to implement one more method, check Articus\DataTransfer\Strategy\MergerInterface::merge for details.
Migrate to Laminas
More or less it is just a namespace change both in your code and in your configuration. Check official guide for useful tips.
Check metadata cache configuration for production environment
Previously simple file caching for metadata required two extra dependencies ( zendframework/zend-cache and zendframework/zend-serializer) and quite lengthy configuration:
Articus\DataTransfer\MetadataProvider\Annotation:
cache:
adapter: filesystem
options:
cache_dir: data/DataTransfer
namespace: dt
plugins:
serializer:
serializer: phpserialize
Now it requires only one extra dependency psr/simple-cache and tiny configuration:
Articus\DataTransfer\MetadataProvider\Annotation:
cache:
directory: data/DataTransfer
If you use separate caching service no configuration changes should be needed.