Skip to content

[VarDumper] Code excerpts and trailing commas #24581

Closed
@ogizanagi

Description

@ogizanagi
Q A
Bug report? yesish
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3

When using the DUMP_COMMA_SEPARATOR or DUMP_COMMA_SEPARATOR flags, a trailing comma is added to each line. But when dumping an exception, adding a comma at the end of each line of the code excerpt looks a bit unexpected to me:

screenshot 2017-10-16 a 22 40 59

RuntimeException {
  #message: "foo",
  #code: 0,
  #file: "./src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php",
  #line: 181,
  trace: {
    ./src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php:181 {
      › ,
      › $ex = new \RuntimeException('foo');,
      › ,
    },
    Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest->testDumpWithCommaFlagsAndExceptionCodeExcerpt() {},
    ./.phpunit/phpunit-6.0/src/Framework/TestCase.php:1042 { …},
    ./.phpunit/phpunit-6.0/src/Framework/TestCase.php:901 { …},
  },
}

See ogizanagi@1f624ae for a simple test case reproducing this.

Does it worth an improvement?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions