Skip to content

[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

Merged
merged 1 commit into from
Jan 14, 2016

Conversation

nicolas-grekas
Copy link
Member

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?


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.
Copy link
Member

Choose a reason for hiding this comment

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

repreesentation -> representation

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed thx

@nicolas-grekas nicolas-grekas force-pushed the dump-flags branch 2 times, most recently from 056c866 to ee4f8a9 Compare January 11, 2016 18:46
@nicolas-grekas
Copy link
Member Author

ping @symfony/deciders

@@ -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) {
Copy link
Member

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).

Copy link
Member Author

Choose a reason for hiding this comment

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

swapped

@dunglas
Copy link
Member

dunglas commented Jan 14, 2016

Status: reviewed

👍

@xabbuh
Copy link
Member

xabbuh commented Jan 14, 2016

👍

@nicolas-grekas nicolas-grekas merged commit a35ceb0 into symfony:master Jan 14, 2016
nicolas-grekas added a commit that referenced this pull request Jan 14, 2016
…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
@nicolas-grekas nicolas-grekas deleted the dump-flags branch January 14, 2016 09:14
@fabpot fabpot mentioned this pull request May 13, 2016
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.

5 participants