Skip to content
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

Add format output option #640

Merged
merged 3 commits into from
Oct 28, 2016

Conversation

AyrtonRicardo
Copy link

  • Add test
  • Add format output option

@goetas
Copy link
Collaborator

goetas commented Sep 9, 2016

this is a XML specific option, and should not be part of the global context.

have a look to https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/JsonSerializationVisitor.php#L48 for an alternative implementation.

4be3f29 added a similar feature for JSON

@AyrtonRicardo
Copy link
Author

AyrtonRicardo commented Sep 9, 2016

@goetas I agree with you.
Done.

I'll do PR to SerializerBundle with the option on the DI after your OK here! 😄

@goetas
Copy link
Collaborator

goetas commented Sep 9, 2016

looks good to me! 👍

@AyrtonRicardo
Copy link
Author

@goetas done schmittjoh/JMSSerializerBundle#527

@goetas goetas added this to the v1.4 milestone Sep 9, 2016
@@ -44,10 +44,14 @@ class XmlSerializationVisitor extends AbstractVisitor
private $nullWasVisited;
private $objectMetadataStack;

/** @var boolean */
private $formatOutput;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set it default to false, please

we had some bugs fro such kind of implementation (#317)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's default true, setted on constructor. It's default true because it was true before.

@goetas goetas merged commit 94b3c98 into schmittjoh:master Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants