Skip to content

Preserve unmatched union values instead of null#181

Open
alexchexes wants to merge 3 commits intofix/code-stylefrom
cdx/fix-union-handling-for-invalid-inputs__2025-08-18__08-14-55
Open

Preserve unmatched union values instead of null#181
alexchexes wants to merge 3 commits intofix/code-stylefrom
cdx/fix-union-handling-for-invalid-inputs__2025-08-18__08-14-55

Conversation

@alexchexes
Copy link
Owner

Summary

  • keep original value when none of a union's branches validate
  • guard union branch validation to avoid calling object validators on scalars
  • ensure unions serialize raw values when no branch matches

Testing

  • UPDATE_SNAPSHOTS=1 vendor/bin/phpunit
  • vendor/bin/phpstan analyse --memory-limit=512M (fails: Match expression does not handle remaining value: true)

https://chatgpt.com/codex/tasks/task_e_68a2daffe270832d8a82e383587bc987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments