[DataCollector] Improves the readability of the collected arrays in the profiler. #10155

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
6 participants
@sukei
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@wouterj

wouterj Jan 28, 2014

Member

👍

Member

wouterj commented Jan 28, 2014

👍

@vicb

View changes

src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php
{
if (is_object($value)) {
return sprintf('Object(%s)', get_class($value));
}
+ if (is_array($value) && empty($value)) {

This comment has been minimized.

@vicb

vicb Jan 31, 2014

Contributor

may be this should be merged with the if just below ?

@vicb

vicb Jan 31, 2014

Contributor

may be this should be merged with the if just below ?

This comment has been minimized.

@sukei

sukei Jan 31, 2014

Contributor

I made it this way to improve readability, but you are right.

@sukei

sukei Jan 31, 2014

Contributor

I made it this way to improve readability, but you are right.

@sukei

This comment has been minimized.

Show comment
Hide comment
@sukei

sukei Feb 17, 2014

Contributor

Nobody want that? 😟

Contributor

sukei commented Feb 17, 2014

Nobody want that? 😟

@sstok

This comment has been minimized.

Show comment
Hide comment
@sstok

sstok Feb 28, 2014

Contributor

Can you add some tests?

Contributor

sstok commented Feb 28, 2014

Can you add some tests?

+ return '[]';
+ }
+
+ $indent = str_repeat(' ', $depth);

This comment has been minimized.

@cordoval

cordoval Feb 28, 2014

Contributor

is here 2 spaces or 4 spaces better?

@cordoval

cordoval Feb 28, 2014

Contributor

is here 2 spaces or 4 spaces better?

@cordoval

This comment has been minimized.

Show comment
Hide comment
@cordoval

cordoval Feb 28, 2014

Contributor

👍 it is a good idea

Contributor

cordoval commented Feb 28, 2014

👍 it is a good idea

@fabpot

This comment has been minimized.

Show comment
Hide comment
@fabpot

fabpot Feb 28, 2014

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@sukei

sukei Feb 28, 2014

Contributor

I have a 2.4.1 and it just works as expected.

profiler

Contributor

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

feature #10352 [DataCollector] Improves the readability of the collec…
…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 sukei:value-exporter branch Mar 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment