Skip to content

Releases: Articus/DataTransfer

v0.6.3

03 Jan 18:19
Compare
Choose a tag to compare

New features

New strategy Articus\DataTransfer\Strategy\SerializableValue and new validator Articus\DataTransfer\Validator\SerializableValue provide configurable mechanism to deal with untyped data that is a result of typed data serialization.

v0.6.2

18 Feb 14:02
Compare
Choose a tag to compare

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

04 Feb 22:33
Compare
Choose a tag to compare

Enhancements

  • Articus\DataTransfer\Strategy\Factory\SimplePluginManager and Articus\DataTransfer\Validator\Factory\SimplePluginManager now enable instance sharing by default for build-in strategies and validators

v0.6

23 Apr 21:58
Compare
Choose a tag to compare

Enhancements

  • minimal PHP version bump to 7.4 - it became too cumbersome to support 7.1 :(
  • laminas/laminas-servicemanager is no longer a direct dependency - now library uses articus/plugin-manager for plugin managers

Migration notes

  • classes Articus\DataTransfer\Strategy\PluginManager and Articus\DataTransfer\Validator\PluginManager were removed, but their names are still used for configuration. So you may need to update type hints in your code and/or switch ::class usages to new constants from Articus\DataTransfer\Options.
  • class Articus\DataTransfer\Strategy\Factory\PluginManager was removed - use either Articus\DataTransfer\Strategy\Factory\SimplePluginManager or Articus\DataTransfer\Strategy\Factory\LaminasPluginManager instead.
  • class Articus\DataTransfer\Validator\Factory\PluginManager was removed - use either Articus\DataTransfer\Validator\Factory\SimplePluginManager or Articus\DataTransfer\Validator\Factory\LaminasPluginManager instead.

v0.5.3

12 Apr 20:29
Compare
Choose a tag to compare

Enhancements

  • Articus\DataTransfer\Strategy\IdentifiableValueMap now supports maps with integer keys (previously only string keys were allowed)

v0.5.2

20 Nov 23:09
Compare
Choose a tag to compare

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

09 May 11:56
Compare
Choose a tag to compare

Enhancements

  • refinement for exceptions thrown in build-in strategies - now extract/merge/hydrate throw Articus\DataTransfer\Exception\InvalidData if input data is badly mangled

v0.5

21 Mar 20:58
Compare
Choose a tag to compare

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\IdentifiableValue and Articus\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

10 Jan 17:58
Compare
Choose a tag to compare

Enhancements

v0.4

04 Oct 11:23
Compare
Choose a tag to compare

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.