-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | no |
Currently VarDumper (specifically \Symfony\Component\VarDumper\Dumper\CliDumper
) replaces common control characters with their visible representation. There's however a problem with this approach - copied result is unusable without manual modification.
I was thinking about solving the problem. For new lines solution will be bare simple - giving some control over \Symfony\Component\VarDumper\Dumper\CliDumper::$controlCharsMap
, which easily let's the developer to create print like the one below:
This solution however is slightly hacky in my opinion, since in order to achieve such result I had to create such definition:
protected static $controlCharsMap = array(
"\t" => '\t',
"\n" => "",
"\v" => '\v',
"\f" => '\f',
"\r" => '\r',
"\033" => '\e',
);
Maybe there's a way to make just copying usable? In HTML we can offer option to copy raw string, without any enhancements like control characters replacement. For CLI there's no such way unfortunately...
Do you have any ideas how to improve DX of this functionality?