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

Allow usage with zend-hydrator v3 #172

Merged

Conversation

weierophinney
Copy link
Member

There are two key differences in zend-hydrator v3 we need to accommodate.

First, we have added the HydratorPluginMangerInterface to zend-hydrator v3. This means that any references to HydratorPluginManager when doing type-hinting need to be expanded to allow the more general interface. This patch updates any cases where HydratorPluginManager was accepted as an argument to make the argument mixed, and do type-checking internally; cases where HydratorPluginManager was returned have been updated to allow either type.

Second, the ExtractionInterface was updated in v3 to add parameter and return typehints, which affects the EntityExtractor. To accommodate the two different signatures, this patch creates two versions of that class, and then adds an autoloading rule that aliases the original name to the correct version.

zend-hydrator v3 is backwards compatible for consumers, and trivially
adoptable via class aliasing for implementors. This patch:

- adds 3.0 to the list of allowed version for zend-hydrator,
- updates the travis configuration to add the package as a legacy dependency in locked versions prior to PHP 7.2.
- moves the test coverage run to PHP 7.1 locked, and excludes the v3 extractor variant from coverage to ensure no parse errors occur
There are two key differences in zend-hydrator v3 we need to
accommodate.

First, we have added the `HydratorPluginMangerInterface` to
zend-hydrator v3. This means that any references to
`HydratorPluginManager` when doing type-hinting need to be expanded to
allow the more general interface. This patch updates any cases where
`HydratorPluginManager` was accepted as an argument to make the argument
mixed, and do type-checking internally; cases where
`HydratorPluginManager` was returned have been updated to allow either
type.

Second, the `ExtractionInterface` was updated in v3 to add parameter and
return typehints, which affects the `EntityExtractor`. To accommodate
the two different signatures, this patch creates two versions of that
class, and then adds an autoloading rule that aliases the original name
to the correct version.
@coveralls
Copy link

Coverage Status

Coverage decreased (-3.2%) to 72.031% when pulling f8166bb on weierophinney:feature/zend-hydrator-v3 into 6a076c6 on zfcampus:develop.

@weierophinney weierophinney merged commit f8166bb into zfcampus:develop Dec 11, 2018
weierophinney added a commit that referenced this pull request Dec 11, 2018
weierophinney added a commit that referenced this pull request Dec 11, 2018
@weierophinney weierophinney deleted the feature/zend-hydrator-v3 branch December 11, 2018 19:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants