-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
components/var_dumper/advanced.rst
Outdated
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. |
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.
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.
components/var_dumper/advanced.rst
Outdated
@@ -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. |
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.
We should enclose HTMLDumper with double backticks and change it to HtmlDumper
to reflect the actual class name.
components/var_dumper/advanced.rst
Outdated
|
||
* 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. |
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.
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!
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.
I described the flags in more detail now and moved the section to the end of the paragraph. :)
components/var_dumper/advanced.rst
Outdated
@@ -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. |
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.
Oh, can we please revert this change? :)
components/var_dumper/advanced.rst
Outdated
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``. |
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.
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).
components/var_dumper/advanced.rst
Outdated
* If ``DUMP_STRING_LENGTH`` is set, then the length of a string is displayed | ||
next to its content. | ||
|
||
:: |
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.
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.
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.
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).
components/var_dumper/advanced.rst
Outdated
|
||
* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are dumped in a shortened format. | ||
|
||
:: |
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.
same here
components/var_dumper/advanced.rst
Outdated
// 0 => (4) "test" | ||
// ] | ||
|
||
* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are dumped in a shortened format. |
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.
Maybe add "similar to PHP's short array notation" in parentheses after "shortened format"?
Thanks for all the help so far :) |
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.
👍 @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!
Thank you @sawmurai. |
…(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
* 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 ...
Pull request for ticket #7177