[7.0] Support full payload for concrete resolver#49
Merged
Conversation
Extended the Hydrator to accept and process additional data during object hydration. Updated relevant methods, tests, and resolvers to accommodate this change. This enhancement improves flexibility in handling complex data structures.
[ci skip] [skip ci]
Apply fixes from StyleCI
Ensure the 'name' property is correctly validated in tests. This improves test coverage and helps prevent potential regressions for this property.
Introduce a keys tracking mechanism to manage processed data keys, replacing the use of `unset`. This improves clarity and ensures unprocessed data is cleanly managed before invoking `__set`.
[ci skip] [skip ci]
Apply fixes from StyleCI
Lukasss93
approved these changes
May 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request introduces updates to the
Hydratorclass and related components to support additional contextual data during object hydration. It also updates dependencies and adds new test coverage for the changes. The most significant changes include modifications to method signatures, enhancements to the hydration process, and updates to the test suite.Updates to Dependencies:
phpunit/phpunitincomposer.jsonto version^10for compatibility with the latest PHPUnit features.Enhancements to Hydration Process:
array $additionalparameter to multiple methods in theHydratorclass, includinghydrate,initializeObject,hydrateProperty, and others, to allow passing additional contextual data during hydration. [1] [2] [3]hydrateObjectsInArraymethod to propagate theadditionalparameter when recursively hydrating nested objects.propertyFromInstanceandpropertyArraymethods to utilize theadditionalparameter during object hydration. [1] [2]Changes to Abstract Resolvers:
concreteFormethod in theConcreteResolverabstract class to accept an additionalarray $allparameter, enabling more contextual decision-making when resolving concrete implementations. [1] [2]Test Suite Enhancements:
testHydrateAbstractPropertyWithAdditional, to validate the behavior of theHydratorclass when using theadditionalparameter during object hydration.ObjectWithAbstractfixture to include a newnameproperty for testing purposes.