fix(flow-php/types): structure/list/map casting no longer fabricates missing data - #2595
Merged
Conversation
…missing data - absent or present-null structure elements whose type rejects null throw CastingException with MissingElementCastingException as previous, naming the element - list/map cast(null) throws instead of returning empty; JSON string payloads decode and cast element-wise - all-optional structures now accept an empty payload (array_is_list([]) rejected it) - native extension bails to PHP cast for null non-optional elements, keeping exception parity
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #2595 +/- ##
=========================================
Coverage 86.44% 86.44%
- Complexity 23305 23309 +4
=========================================
Files 1833 1834 +1
Lines 72314 72331 +17
=========================================
+ Hits 62513 62530 +17
Misses 9801 9801 🚀 New features to boost your workflow:
|
… the empty-payload cast fix
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.
Change Log
Added
flow-php/types-MissingElementCastingExceptionnaming the failing structure element viagetPrevious()Fixed
flow-php/types- structure cast no longer fabricates values for absent or null elements whose type rejects nullflow-php/types- list/map cast of null throws instead of returning an empty collectionflow-php/types- structures with only optional elements accept an empty payloadflow-php/flow-php-ext- native cast defers null non-optional elements to PHP, keeping exception parityChanged
flow-php/types- JSON string payloads for structure/list/map decode and cast element-wiseRemoved
Deprecated
Security