Commit 3ea00fe
authored
feat(validated-dto): support Cast attribute for DTOCast type (#958)
This change improves the handling of Cast attributes in SimpleDTO by treating DTOCast similarly to EnumCast - both now pass the class name directly as a parameter instead of instantiating it.
Changes:
- Updated SimpleDTO.php to handle DTOCast in the match expression alongside EnumCast
- Modified CallableCastingDTOInstance test to use Cast attribute instead of manual casts() method
- Ensures consistency in how different cast types are handled
This refactor simplifies the code and allows Cast attributes to work correctly with DTOCast type.
Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>1 parent 4b7eb8e commit 3ea00fe
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
327 | | - | |
328 | | - | |
329 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
0 commit comments