This repository was archived by the owner on May 8, 2026. It is now read-only.
Fix : MapAdapter to serialize Long keys as integer instead of string#13
Open
gowoonsori wants to merge 1 commit into
Open
Fix : MapAdapter to serialize Long keys as integer instead of string#13gowoonsori wants to merge 1 commit into
gowoonsori wants to merge 1 commit into
Conversation
Owner
|
Hi @gowoonsori, this project is no longer actively maintained, and I don't have the time to keep it updated. I'd recommend forking it and maintaining your own version. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Hi, thanks for this great library! I've been using it in my project and it works really well.
I found a small issue with
MapAdapterand wanted to contribute a fix.Problem
When a
MaphasLongtype keys,MapAdapterfalls through to theelsebranch and calls
key.toString(), resulting in the key being serialized as aPHP string (
s:) instead of an integer (i:).For example, a map with key
1Lwould produce:a:1:{s:1:"1";s:5:"value";}a:1:{i:1;s:5:"value";}Changes
Longinstanceof check inMapAdapterto write integer keys viawriter.writeKey((long) key)writeKey(long)overload inWriterto support long type keysMapAdapterTestNotes
This is consistent with the existing
writeInteger(Long)method inWriter,which already serializes Long values using the
i:format.