Skip to content

[POC] [VarDumper] Added StringDumper to export dump as string #19616

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

Closed
wants to merge 1 commit into from

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Aug 14, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18149
License MIT
Doc PR todo

This allows to export dumps as a string, instead of having it dumped to a stream. This is usefull when using the VarDumper as var exporter (e.g. in #19614 & see referenced issue).

Todo

  • Fix TwigBridge usage

@wouterj wouterj changed the title [VarDumper] Added StringDumper to export dump as string [POC] [VarDumper] Added StringDumper to export dump as string Aug 14, 2016
$this->dumper = $dumper ?: new HtmlDumper();

if (null === $dumper || !$dumper instanceof ToStringDumper) {
$this->dumper = new ToStringDumper(new HtmlDumper());
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we wrap passed dumper instead of silent replace it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, that's a typo

@nicolas-grekas
Copy link
Member

I'm rather 👎 here. It hides how things work (for a reason). I submitted #19624 instead, to make getting a string simpler.
I also target #17290 as a more generic approach to make getting & customizing dumps easier.

@wouterj wouterj deleted the var-dumper/string-dumper branch August 19, 2016 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants