-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper][HttpKernel] Add context to all dumps #28395
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
2807858
to
2f49e78
Compare
$name = $file; | ||
} | ||
|
||
$this->line = $this->style('meta', $name, $attr).' on line '.$this->style('meta', $line).':'; |
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.
In this scenario, we are 100% sure that the dumper is an instance of CliDumper
so those methods are safe to use.
I'd prefer not doing this change personally: when debugging, it's already hard enough to figure out what's going on, I'd prefer not having to visually parse extra output... |
The location of the dump is already printed in the dump-server and when the toolbar is used, isn't it? |
When you only use the When you use the For the cli dumps, I can understand and agree with the loop example. However, currently, when you use the dump server, 7 lines and displayed before each dump. Example with a loop : |
@nicolas-grekas Any more inputs here? |
Sure, I'm 👎 |
Let's close then. |
Following some discussion in #28317, I think it would be nice if the default
VarDumper
handler would add where thedump
calls comes from. This is the case when theDebugBundle
is enabled on html dumps. The behavior I added is exactly the same.I also added it for cli dumps, but for those one I think it's actually better to display the file path instead of just the class name as sometimes you have multiple classes with the same name. This is not a problem for html dumps since there is a title attribute on the span or on the link.