-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DataCollector] Improves the readability of the collected arrays in the profiler. #10155
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
👍 |
{ | ||
if (is_object($value)) { | ||
return sprintf('Object(%s)', get_class($value)); | ||
} | ||
|
||
if (is_array($value) && empty($value)) { |
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.
may be this should be merged with the if
just below ?
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.
I made it this way to improve readability, but you are right.
Nobody want that? 😟 |
Can you add some tests? |
return '[]'; | ||
} | ||
|
||
$indent = str_repeat(' ', $depth); |
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.
is here 2 spaces or 4 spaces better?
👍 it is a good idea |
I don't understand how it could work with just these modifications. In my test on Symfony 2.3, 2.4, and 2.5, it just did not had the expected behavior described here. So, I've made the needed changes in #10352 |
…ted arrays in the profiler (fabpot) This PR was merged into the 2.5-dev branch. Discussion ---------- [DataCollector] Improves the readability of the collected arrays in the profiler | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT This PR is based on #10155. Original description: It simply improves the readability of the collected arrays in the profiler: __before__: ``` Array(date => Array(year => , month => , day => ), time => Array(hour => )) ``` __after__: ``` [ date => [ year => , month => , day => ], time => [ hour => ] ] ``` Commits ------- dce66c9 removed double-stringification of values in the profiler 1cda2d4 [HttpKernel] tweaked value exporter 3f297ea Improves the readability of the collected arrays in the profiler.
It simply improves the readability of the collected arrays in the profiler:
before:
after: