-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatability with new JMS\PropertyMetadata interface #30
base: master
Are you sure you want to change the base?
Conversation
It would be even better if this bundle could support both JMSSerializerBundle 0.9 and 1.0.x-dev for now (some people prefer waiting for releases before updating) |
I couldn't find right way to determine version of JMSSerializer. Only indirect, such as "if (is_array($type))" or "if ( interface_exists("\JMS\SerializerBundle\Serializer\Handler\SerializationHandlerInterface") )". Do you think it's good enough to implement it that way? |
@iVariable you don't need to check the version IMO. Using |
Any chance to amend and push this through? |
JMS\SerializerBundle\Metadata\PropertyMetadata interface for type has changed. Here is a quickfix for it. Two versions of JMS Serializer support
Oops, sorry. Have missed previous comment. PS: I preferred to make simple "if" instead of something like getTypeFromOldSerializer and getTypeFromNewSerializer :)) |
Well, instead of duplicating the whole code of the function (requiring to maintain it twice), it would be easier to normalize the type at the beggining: if (is_array($type)) {
// handle JMSSerializerBundle >= 0.10
$type = $type['name'];
}
// All the existing code here without any modification |
Don't you forgot about $type['params'] part? And as for me I think this patch is just a quickfix before maintaining JMSSerializer version 1.0. It'll be better to remove support of old Serializer, after Serializer version 1 release. Don't you think so? |
JMS\SerializerBundle\Metadata\PropertyMetadata interface for $type has changed.
Here is a quickfix for it.