Skip to content

Conversation

@sergix44
Copy link
Member

This pull request introduces updates to the Hydrator class 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:

  • Updated phpunit/phpunit in composer.json to version ^10 for compatibility with the latest PHPUnit features.

Enhancements to Hydration Process:

  • Added an array $additional parameter to multiple methods in the Hydrator class, including hydrate, initializeObject, hydrateProperty, and others, to allow passing additional contextual data during hydration. [1] [2] [3]
  • Updated the hydrateObjectsInArray method to propagate the additional parameter when recursively hydrating nested objects.
  • Enhanced the propertyFromInstance and propertyArray methods to utilize the additional parameter during object hydration. [1] [2]

Changes to Abstract Resolvers:

  • Modified the concreteFor method in the ConcreteResolver abstract class to accept an additional array $all parameter, enabling more contextual decision-making when resolving concrete implementations. [1] [2]

Test Suite Enhancements:

  • Added a new test, testHydrateAbstractPropertyWithAdditional, to validate the behavior of the Hydrator class when using the additional parameter during object hydration.
  • Updated the ObjectWithAbstract fixture to include a new name property for testing purposes.

sergix44 and others added 3 commits May 17, 2025 00:09
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]
@sergix44 sergix44 requested a review from Lukasss93 May 16, 2025 22:10
sergix44 and others added 4 commits May 17, 2025 00:13
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]
@sergix44 sergix44 merged commit d49cc4b into master May 20, 2025
6 checks passed
@sergix44 sergix44 deleted the support-full-payload-for-concrete-resolver branch May 20, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants