Repository navigation
Preserve existing null values when a get() default is provided - #56
Open
Zhuyuyangyy wants to merge 3 commits into
Open
Zhuyuyangyy wants to merge 3 commits into
Zhuyuyangyy wants to merge 3 commits into
Conversation
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.
Summary
Closes #55.
get()already distinguishes missing keys witharray_key_exists()during traversal, but its final return replaces an existing null with the caller's default. Return the traversed value unchanged, consistent with the interface contract and the v3.0.0 null-key fix. Missing paths still use the existing default/exception handling.Add regression coverage for top-level and nested null-valued paths,
has()consistency, and an actually missing path. Clarify the interface/README and add an Unreleased changelog entry.Validation
The new regression fails on the original source (
fallbackinstead of null) and passes after the fix. On native PHP 8.2.35:git diff --check: passedThese are the four local checks defined by
composer test, invoked individually. Test tools were installed using a temporary local manifest retaining the project's tool constraints and omitting the unused legacyscrutinizer/ocularcoverage-upload dependency; no project dependency declarations or lock files are changed, no audit/security blocking was bypassed in the final validation environment, and no coverage was uploaded. This does not claim a complete upstream CI run.AI assistance was used for investigation, patch preparation, and local validation.