-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix issue #199: "array" type ignoring DateTime format #201
Conversation
deserialization of named DateTime array from XML currently fails!
@@ -99,7 +99,8 @@ public function visitArray($data, array $type, Context $context) | |||
} | |||
|
|||
foreach ($data as $k => $v) { | |||
$v = $this->navigator->accept($v, isset($type['params'][1]) ? $type['params'][1] : null, $context); | |||
$typeArray = isset($type['params'][0]) ? (isset($type['params'][1]) && is_array($type['params'][1]) ? $type['params'][1] : $type['params'][0]) : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about renaming this to elementType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also rewrite this condition, it's getting too long. Maybe move this to a separate method getElementType($arrayType)
.
As I said on the other issue |
refactored tests to exclude deserializing XmlKeyValuePairs
Thanks for your comments. I tried to implement it that way. Hope it's ok. |
…atch @alex88's Serialize only form child of type Form schmittjoh#117
ping! |
Sorry for the wait. I remember that there were a few coding style issues here (nothing big). You often use short if/foreach statements, could you make sure that their body is always enclosed in Could you also rebase/merge latest master so that your PR can be tested/analyzed? Please also add a comment if everything goes green so I can merge right away :) |
deserialization of named DateTime array from XML currently fails!
refactored tests to exclude deserializing XmlKeyValuePairs
Conflicts: src/JMS/Serializer/AbstractVisitor.php tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php tests/JMS/Serializer/Tests/Serializer/JsonSerializationTest.php
Ok, had some minor issues with integrating latest master, but should be ok now. Tests are inside and passing green. Thanks! |
fix issue #199: "array" type ignoring DateTime format
Great, thanks! |
fixes issue #199
Need feedback for XML deserialization of type("array<string,DateTime>) with XmlKeyValuePairs. Currently the test is failing.