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

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

Already on GitHub?Sign in to your account

Closed
Nyholm wants to merge4 commits intosymfony:masterfromNyholm:message-profiler-clone

Conversation

@Nyholm
Copy link
Member

@NyholmNyholm commentedMar 23, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsna
LicenseMIT
Doc PRna

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

screen shot 2018-03-23 at 11 08 02


{%blocktoolbar %}
{%setcolor_code='normal' %}
{%setmessage_count=0 %}
Copy link
MemberAuthor

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?

Copy link
Contributor

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 }}
Copy link
Contributor

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 %}

{%ifmessage.result.objectisdefined %}
Copy link
Contributor

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 themessage.result.type.


{%blocktoolbar %}
{%setcolor_code='normal' %}
{%setmessage_count=0 %}
Copy link
Contributor

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 🙊

@Nyholm
Copy link
MemberAuthor

Thank you for the review

screen shot 2018-03-23 at 11 27 31

'type' =>get_class($result),
'object' =>$this->cloneVar($result),
);
}else {
Copy link
Member

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

Copy link
Member

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 ?

@chalasrchalasr added this to the4.1 milestoneMar 23, 2018
@stof
Copy link
Member

IMO, messages should not be stored directly in$this->data in the collector, as this forbids us to store anything else in the future in this collector in case we need to collect more things. You should probably move this to$this->data['messages'] instead.

@Nyholm
Copy link
MemberAuthor

Thank you for the review

Copy link
Contributor

@srozesroze left a 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)

@sroze
Copy link
Contributor

@Nyholm could you squash your commits?
@stof can you have another look please?

@NyholmNyholmforce-pushed themessage-profiler-clone branch from5700de0 to52f4da9CompareMarch 26, 2018 10:40
@Nyholm
Copy link
MemberAuthor

Done

Copy link
Contributor

@srozesroze left a 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;
Copy link
Member

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 makegetMessages work without notice aftercollect has been called.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you

Copy link
Contributor

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 😉

Copy link
MemberAuthor

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?

https://3v4l.org/tubTL

Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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.

publicfunctiongetMessages():array
{
return$this->data;
if (!isset($this->data['messages'])) {
Copy link
Contributor

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 thearray(), this will make fabbot happy)

@Nyholm
Copy link
MemberAuthor

Thank you

@NyholmNyholmforce-pushed themessage-profiler-clone branch fromff354df to359a658CompareMarch 27, 2018 07:37
@Nyholm
Copy link
MemberAuthor

I've rebased this PR now. Im ready for a final review.

@fabpot
Copy link
Member

Thank you@Nyholm.

@fabpotfabpot closed thisMar 27, 2018
fabpot added a commit that referenced this pull requestMar 27, 2018
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        | naWe should make the profiler page more pretty by using the cloner.![screen shot 2018-03-23 at 11 08 02](https://user-images.githubusercontent.com/1275206/37823687-816a373a-2e8a-11e8-824e-ac7f96a51e3b.png)Commits-------4d1be87 [Messenger] Clone messages to show in profiler
@NyholmNyholm deleted the message-profiler-clone branchMarch 27, 2018 07:52
@fabpotfabpot mentioned this pull requestMay 7, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@stofstofstof approved these changes

+1 more reviewer

@srozesrozesroze requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

6 participants

@Nyholm@stof@sroze@fabpot@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp