This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Allow usage with zend-hydrator v3 #224
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch provides compatibility with zend-hydrator v3, while retaining compatibility with versions 1 and 2.
The primary change that affects this package is that the default shipped hydrators were given the suffix
Hydrator
. The original still exist, but emit deprecation notices when used.The
Fieldset
class is the only one in the source library that references a specific hydrator. That reference was changed to check if the v3 variant exists, using that when found and the v1/v2 variant otherwise. Additionally, due to the stricter typehints in zend-hydrator v3, a check was necessary withinbindValues()
for a populated$object
property prior to attemting hydration.The bulk of the effort was getting the tests to pass with both versions, as the deprecation notices can prevent test passage when v3 is installed. All tests were updated to vary hydrator usage based on zend-hydrator version installed. In a number of cases, test assets were duplicated when varying was impossible to perform programmatically; for these cases, I provided autoload-dev rules that perform class aliases.