Skip to content

[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

Closed
wants to merge 2 commits into from
Closed

Conversation

sukei
Copy link
Contributor

@sukei sukei commented Jan 28, 2014

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

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 => 
  ]
]

@wouterj
Copy link
Member

wouterj commented Jan 28, 2014

👍

{
if (is_object($value)) {
return sprintf('Object(%s)', get_class($value));
}

if (is_array($value) && empty($value)) {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

@sukei
Copy link
Contributor Author

sukei commented Feb 17, 2014

Nobody want that? 😟

@sstok
Copy link
Contributor

sstok commented Feb 28, 2014

Can you add some tests?

return '[]';
}

$indent = str_repeat(' ', $depth);
Copy link
Contributor

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?

@cordoval
Copy link
Contributor

👍 it is a good idea

@fabpot
Copy link
Member

fabpot commented Feb 28, 2014

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

@fabpot fabpot closed this Feb 28, 2014
@sukei
Copy link
Contributor Author

sukei commented Feb 28, 2014

I have a 2.4.1 and it just works as expected.

profiler

fabpot added a commit that referenced this pull request Mar 1, 2014
…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.
@sukei sukei deleted the value-exporter branch March 2, 2014 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants