Skip to content

Document new environment variables and display options #7217

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

Merged
merged 9 commits into from
Apr 15, 2017
Merged

Document new environment variables and display options #7217

merged 9 commits into from
Apr 15, 2017

Conversation

sawmurai
Copy link
Contributor

@sawmurai sawmurai commented Dec 3, 2016

Pull request for ticket #7177

If ``DUMP_STRING_LENGTH`` is set, then
the length of a string is displayed next to its content.
If ``DUMP_LIGHT_ARRAY`` is set,
then arrays are not displayed completely.
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to render the two sentences as a list? This would then look like this:

The destination and the formatting of this output vary with dumpers and are
influenced by two environment variables:

* If ``DUMP_STRING_LENGTH`` is set, then the length of a string is displayed
  next to its content.
* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are not displayed completely.

@@ -181,6 +186,21 @@ method. They also typically implement the
them from re-implementing the logic required to walk through a
:class:`Symfony\\Component\\VarDumper\\Cloner\\Data` object's internal structure.

The HTMLDumper limits string length and nesting depth of the output.
Copy link
Member

Choose a reason for hiding this comment

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

We should enclose HTMLDumper with double backticks and change it to HtmlDumper to reflect the actual class name.


* If ``DUMP_STRING_LENGTH`` is set, then the length of a string is displayed
next to its content.
* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are not displayed completely.
Copy link
Member

Choose a reason for hiding this comment

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

I don't fully understand the purpose of this option. Looking for DUMP_LIGHT_ARRAY in the code didn't help me either. What does exactly this option do? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I described the flags in more detail now and moved the section to the end of the paragraph. :)

@@ -97,7 +97,7 @@ Dumpers

A dumper is responsible for outputting a string representation of a PHP variable,
using a :class:`Symfony\\Component\\VarDumper\\Cloner\\Data` object as input.
The destination and the formatting of this output vary with dumpers.
The destination and the formatting of this output vary with dumpers.
Copy link
Member

Choose a reason for hiding this comment

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

Oh, can we please revert this change? :)

in the third constructor argument. They can also be set via environment
variables when using
:method:`assertDumpEquals($dump, $data, $message) <Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait::assertDumpEquals>`
during unit testing. The flags can be configured in ``phpunit.xml.dist``.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should better say "in the PHPUnit configuration" (if you are working on a fork you will probably modify the phpunit.xml file to change the behaviour only locally).

* If ``DUMP_STRING_LENGTH`` is set, then the length of a string is displayed
next to its content.

::
Copy link
Member

Choose a reason for hiding this comment

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

If you do not want to terminate the last sentence preceding a code example with a colon, you have to be more explicit and have to use .. code-block:: php instead of the double colon.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, and you will need to indent the whole code example by two additional spaces so that it is part of the list item (same for the other item and code example below).


* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are dumped in a shortened format.

::
Copy link
Member

Choose a reason for hiding this comment

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

same here

// 0 => (4) "test"
// ]

* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are dumped in a shortened format.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add "similar to PHP's short array notation" in parentheses after "shortened format"?

@sawmurai
Copy link
Contributor Author

sawmurai commented Dec 8, 2016

Thanks for all the help so far :)

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

👍 @sawmurai I like this a lot. Thanks!

I've made some minor formatting changes because list of elements are not very readable when they are long, so I replaced it by regular paragraphs. Thanks!

@xabbuh
Copy link
Member

xabbuh commented Apr 15, 2017

Thank you @sawmurai.

@xabbuh xabbuh merged commit 29080a6 into symfony:3.2 Apr 15, 2017
xabbuh added a commit that referenced this pull request Apr 15, 2017
…(sawmurai, javiereguiluz, Fabian Becker)

This PR was merged into the 3.2 branch.

Discussion
----------

Document new environment variables and display options

Pull request for ticket #7177

Commits
-------

29080a6 Minor formatting changes
2ef1b60 Fix format
0c46fce Respect 80 chars line length
6b2248e Fix mention of file
ad90321 Describe flags in more detail
dfb6d6a Trimmed some lines to respect the 80-char soft limit
9340846 Replaced the list to use an unordered list
adbec6d Reformat documentation and link to class doc.
7b26e44 Document new environment variables and display options
xabbuh added a commit that referenced this pull request Apr 15, 2017
weaverryan added a commit that referenced this pull request Apr 15, 2017
* 3.2: (71 commits)
  Rewriting the service container docs
  Minor reword
  Adding a tip for validation in forms without class
  [#7217] add versionadded directives
  [#7203] merge note and versionadded directive
  Use the new configurator YAML syntax
  Added a note about the .htaccess files included by Symfony apps
  Made unmapped field example in forms chapter more descriptive
  [#7507] fix namespace
  [#7507] fix component name
  [#7490] minor typo fix
  Added a note about redirections to absolute URLs in tests
  [#7204] link to API doc
  Added docs for JsonResponse::fromJsonString
  Added the changes suggested by reviewers
  [#7620] use generate() in PHP templates before 2.8
  Fixed the RST syntax
  Improve example context
  Minor formatting changes
  [#7519] some minor tweaks
  ...
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