Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@fancyweb
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

Following some discussion in#28317, I think it would be nice if the defaultVarDumper 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.

@fancywebfancywebforce-pushed thefeat-add-context-to-all-dumps branch from2807858 to2f49e78CompareSeptember 7, 2018 18:54
$name =$file;
}

$this->line =$this->style('meta',$name,$attr).' on line'.$this->style('meta',$line).':';
Copy link
ContributorAuthor

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 ofCliDumper so those methods are safe to use.

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedSep 8, 2018
edited
Loading

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

@fancyweb
Copy link
ContributorAuthor

Here is how it renders :
CLI
cli

HTML
html

@nicolas-grekasnicolas-grekas modified the milestones:2.8,nextSep 8, 2018
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedSep 9, 2018
edited
Loading

The location of the dump is already printed in the dump-server and when the toolbar is used, isn't it?
When debugging e.g. CLI apps, I often end up using dump() in loops. Personally, I'd prefer not having the file+line in the output, as it would mostly be noise to my eyes.
Note that whendd() is used, I'd welcome this change, because, by definition, this will be printed only once.

@fancyweb
Copy link
ContributorAuthor

fancyweb commentedSep 9, 2018
edited
Loading

When you only use theVarDumper component, no location is printed at all. So it would be an improvement for everyone using this component without Symfony, which is currently my case (working on Drupal) ^^

When you use theDebugBundle, a new handler is registered, so this new code will never be used and indeed the location is displayed in the toolbar, in the profiler, in the dump itself (if you die), and in the dump server.

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 :

loop

@fabpot
Copy link
Member

@nicolas-grekas Any more inputs here?

@nicolas-grekas
Copy link
Member

Sure, I'm 👎

@fabpot
Copy link
Member

Let's close then.

@fabpotfabpot closed thisOct 10, 2018
@fancywebfancyweb deleted the feat-add-context-to-all-dumps branchOctober 11, 2018 06:42
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

4 participants

@fancyweb@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp