-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Add flags to allow fine tuning dumps representation #17305
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
7efc4ad
to
e69fe96
Compare
|
||
private $charset; | ||
|
||
/** | ||
* @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput. | ||
* @param string $charset The default character encoding to use for non-UTF8 strings. | ||
* @param int $flags A bit field of static::FLAG_* constants to fine tune dumps repreesentation. |
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.
repreesentation
-> representation
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.
fixed thx
056c866
to
ee4f8a9
Compare
ping @symfony/deciders |
ee4f8a9
to
c7b5d86
Compare
@@ -180,6 +180,9 @@ public function dumpString(Cursor $cursor, $str, $bin, $cut) | |||
$m = count($str) - 1; | |||
$i = $lineCut = 0; | |||
|
|||
if ($this->flags & self::DUMP_STRING_LENGTH) { |
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 would prefer swapping the arguments (imo that's more readable).
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.
swapped
c7b5d86
to
a35ceb0
Compare
Status: reviewed 👍 |
👍 |
…sentation (nicolas-grekas) This PR was merged into the 3.1-dev branch. Discussion ---------- [VarDumper] Add flags to allow fine tuning dumps representation | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15856 | License | MIT | Doc PR | - The `DUMP_STRING_LENGTH` behavior has been requested in #15856, the `DUMP_LIGHT_ARRAY` behavior is what should have been done for the VarDumperTestTrait. Anticipated usage is opt-in, by adding `<env name="DUMP_LIGHT_ARRAY" value="1" />` in `phpunit.xml.dist`. Any more flags proposal anyone? Better names maybe? Commits ------- a35ceb0 [VarDumper] Add flags to allow fine tuning dumps representation
The
DUMP_STRING_LENGTH
behavior has been requested in #15856,the
DUMP_LIGHT_ARRAY
behavior is what should have been done for the VarDumperTestTrait. Anticipated usage is opt-in, by adding<env name="DUMP_LIGHT_ARRAY" value="1" />
inphpunit.xml.dist
.Any more flags proposal anyone? Better names maybe?