-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Messenger] Clone messages to show in profiler #26650
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
|
|
||
| {% block toolbar %} | ||
| {% set color_code = 'normal' %} | ||
| {% set message_count = 0 %} |
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.
@sroze Any reason why this was zero?
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.
Nop, very likely a mistake 🙊
| <tr> | ||
| <td>{{ message.message.type }}</td> | ||
| <td> | ||
| {{ message.message.type }} |
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 don't believe we still need to display the type anymore if we use the dumper, as the FQCN is available as overlay :)
| {{ message.exception.type }} | ||
| {% endif %} | ||
|
|
||
| {% if message.result.object is defined %} |
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.
Same idea. If defined, I'd display this instead of the message.result.type.
|
|
||
| {% block toolbar %} | ||
| {% set color_code = 'normal' %} | ||
| {% set message_count = 0 %} |
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.
Nop, very likely a mistake 🙊
| 'type' => get_class($result), | ||
| 'object' => $this->cloneVar($result), | ||
| ); | ||
| } else { |
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.
should be cloned as well in case it is an array, as it might contain objects inside the array
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.
btw, the template does not seem to use the value in this case when rendering the info, so why storing it ?
|
IMO, messages should not be stored directly in |
|
Thank you for the review |
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.
Looks good to me 👍 (after squashing the commits, obsly)
5700de0 to
52f4da9
Compare
|
Done |
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.
Failure in un-related 👍
| } | ||
|
|
||
| $this->data[] = $debugRepresentation; | ||
| $this->data['messages'][] = $debugRepresentation; |
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.
collect must ensure that $this->data['messages'] is always an array, even when no message was handled there, to make getMessages work without notice after collect has been called.
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.
Thank you
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.
@Nyholm your changes did not fix this btw 😉
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.
Doesn't it?
Cant I trust that $this->data always to be null or an array?
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.
Actually, you're right, it won't "throw" a PHP notice.
| } | ||
|
|
||
| $this->data[] = $debugRepresentation; | ||
| $this->data['messages'][] = $debugRepresentation; |
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.
@Nyholm your changes did not fix this btw 😉
| } | ||
|
|
||
| $this->data[] = $debugRepresentation; | ||
| $this->data['messages'][] = $debugRepresentation; |
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.
Actually, you're right, it won't "throw" a PHP notice.
| public function getMessages(): array | ||
| { | ||
| return $this->data; | ||
| if (!isset($this->data['messages'])) { |
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.
return $this->data['messages'] ?? array();(note the array(), this will make fabbot happy)
|
Thank you |
ff354df to
359a658
Compare
|
I've rebased this PR now. Im ready for a final review. |
|
Thank you @Nyholm. |
This PR was squashed before being merged into the 4.1-dev branch (closes #26650). Discussion ---------- [Messenger] Clone messages to show in profiler | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | na | License | MIT | Doc PR | na We should make the profiler page more pretty by using the cloner.  Commits ------- 4d1be87 [Messenger] Clone messages to show in profiler

We should make the profiler page more pretty by using the cloner.