Skip to content

Refactor v2#21

Merged
crtl merged 6 commits into2.xfrom
refactor-v2
Feb 9, 2026
Merged

Refactor v2#21
crtl merged 6 commits into2.xfrom
refactor-v2

Conversation

@crtl
Copy link
Owner

@crtl crtl commented Feb 8, 2026

Description

Please include a summary of the changes and the related issue.

Closes #...

What type of PR is this? (check all applicable)

  • Bug Fix
  • Feature
  • Refactor
  • Deprecation
  • Breaking Change
  • Documentation Update
  • CI

Checklist

  • I have made corresponding changes to the documentation

crtl added 2 commits February 8, 2026 02:18
… detection

Reworked DTO hydration and validation to rely fully on Symfony Validator
and a centralized `RequestDtoFactory`.

- Introduce a new `RequestDtoFactory` to handle recursive DTO instantiation
- Detect circular DTO references and throw `CircularReferenceException`
- Streamline hydration/validation flow and merge hydration violations correctly
- Remove custom `RequestDtoValidator` and `GroupSequenceExtractor`
- Integrate `QueryParam` type transformation into the factory
- Fix duplicate violation registration caused by name collisions
- Improve nested DTO handling and null-safety
- Remove `RequestDtoTrait` and update related tests
- Update unit and integration tests to reflect the new architecture

Refs: `phpstan`, `cs-fixer`
BREAKING-CHANGE: Validation and hydration flow has changed; `RequestDtoTrait` was removed
- Adds AbstractParam::hasValueInRequest method.
- Refactors RequestDtoValidator to only assign values that have value in request.
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 86.51163% with 29 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Factory/RequestDtoFactory.php 78.51% 29 Missing ⚠️

📢 Thoughts on this report? Let us know!

…tion edge cases

- Add is_array guard in AbstractNestedParam, coerce non-array nested values in
- RequestDtoFactory, and support QueryParam transformValue in fromArray path.
- Replace individual test methods with parameterized data-provider tests covering
- both fromRequest and fromArray, and add comprehensive fixture DTOs for strict,
- mixed, non-strict, nested, and circular reference scenarios.
@crtl crtl merged commit 83ca5ca into 2.x Feb 9, 2026
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.

1 participant