Skip to content

v0.4

Choose a tag to compare

@Articus Articus released this 04 Oct 11:23
· 23 commits to master since this release

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-servicemanager
    • zendframework/zend-stdlib -> laminas/laminas-stdlib
    • zendframework/zend-validator -> laminas/laminas-validator
  • metadata caching mechanism overhaul:
    • library no longer relies directly on zendframework/zend-cache, you may use any implementation of psr/simple-cache you like
    • simple partial PSR-16 implementation optimized for metadata storage is provided out-of-the-box

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.