Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Allow usage with zend-hydrator v3 #345

Merged
merged 3 commits into from
Dec 11, 2018

Conversation

weierophinney
Copy link
Member

zend-hydrator v3 is backwards compatible from a consumer standpoint. However, when using the v2 hydrator classes under v3, you will receive deprecation notices. This patch does the following to mitigate that:

  • The HydratingResultSet will compose either an ArraySerializable or ArraySerializableHydrator instance, based on version detection of zend-hydrator, when no hydrator is provided to the constructor.
  • Tests were updated to vary which hydrator class is used based on zend-hydrator version detected, allowing them to successfully run.

Additionally, the travis configuration was updated to list zend-hydrator as a legacy dependency for locked versions below PHP 7.2, allowing them to downgrade successfully.

ezimuel and others added 3 commits December 6, 2018 16:36
- Updates `require-dev` constrainte for zend-hydrator to also allow v3
  releases.
- Updates travis configuration to list zend-hydrator as a legacy
  dependency for pre-7.2 versions.
One major change in zend-hydrator v3 is that we have added "Hydrator"
suffixes to all hydrators. The original versions still exist, and can be
used, but emit deprecation notices.

What this change does is version detection: it checks for the new class
name, and uses that as the default if available, falling back to the old
class names. This prevents the deprecation notices, while proving that
both versions work fine with this component.
@weierophinney weierophinney added this to the 2.10.0 milestone Dec 11, 2018
@Ocramius Ocramius self-assigned this Dec 11, 2018
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

I'll push my agenda about bumping dependencies to a later point in time :-P

@Ocramius Ocramius merged commit 4fff35b into zendframework:develop Dec 11, 2018
@weierophinney weierophinney deleted the feature/zend-hydrator-3 branch March 12, 2019 16:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants