[VarDumper] Added a way to print or not comma separator and/or trailing comma #21653

Merged
merged 1 commit into from Feb 20, 2017

Projects

None yet

4 participants

@lyrixx
Member
lyrixx commented Feb 17, 2017
Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Usecase: Be able to display a dump on one line.
It's already used in the following projets: https://github.com/bobthecow/psysh/blob/master/src/Psy/VarDumper/Dumper.php#L93-L95

@@ -107,6 +107,92 @@ class: "Symfony\Component\VarDumper\Tests\CliDumperTest"
);
}
+ public function testGetWithCommaFlag()
+ {
+ require __DIR__.'/Fixtures/dumb-var.php';
@nicolas-grekas
nicolas-grekas Feb 17, 2017 Member

I suggest to use a smaller fixture - one that contains a multiline string - and to test also the DUMP_TRAILING_COMMA flag

@lyrixx
lyrixx Feb 20, 2017 Member

Fixed.

@@ -274,7 +360,7 @@ public function testThrowingCaster()
%sTwig.php:2: {
: foo bar
: twig source
- :
+ :
@nicolas-grekas
nicolas-grekas Feb 17, 2017 Member

should be reverted (breaks tests)

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Feb 18, 2017
@lyrixx lyrixx [VarDumper] Added a way to print or not comma separator and/or traili…
…ng comma

Usecase: Be able to display a dump on one line.
It's already used in the following projets: https://github.com/bobthecow/psysh/blob/master/src/Psy/VarDumper/Dumper.php#L93-L95
1ef0751
@nicolas-grekas

👍

@fabpot
Member
fabpot commented Feb 20, 2017

Thank you @lyrixx.

@fabpot fabpot merged commit 1ef0751 into symfony:master Feb 20, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
@fabpot fabpot added a commit that referenced this pull request Feb 20, 2017
@fabpot fabpot feature #21653 [VarDumper] Added a way to print or not comma separato…
…r and/or trailing comma (lyrixx)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[VarDumper] Added a way to print or not comma separator and/or trailing comma

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

---

Usecase: Be able to display a dump on one line.
It's already used in the following projets: https://github.com/bobthecow/psysh/blob/master/src/Psy/VarDumper/Dumper.php#L93-L95

Commits
-------

1ef0751 [VarDumper] Added a way to print or not comma separator and/or trailing comma
0476eb5
@lyrixx lyrixx deleted the lyrixx:var-dumper-comma branch Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment