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

Appearance settings

[Notifier] Fix notifier profiler when transport name is null #49326

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

Merged
merged 1 commit into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

{% for transport in events.transports %}
<div class="sf-toolbar-info-piece">
<b>{{ transport }}</b>
<b>{{ transport ?: '<em>Empty Transport Name</em>' }}</b>
<span class="sf-toolbar-status">{{ events.messages(transport)|length }}</span>
</div>
{% endfor %}
Expand Down Expand Up @@ -100,7 +100,7 @@
</div>

{% for transport in events.transports %}
<h3>{{ transport }}</h3>
<h3>{{ transport ?: '<em>Empty Transport Name</em>' }}</h3>

<div class="card-block">
<div class="sf-tabs sf-tabs-sm">
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Symfony/Component/Notifier/Event/NotificationEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class NotificationEvents
public function add(MessageEvent $event): void
{
$this->events[] = $event;
$this->transports[$event->getMessage()->getTransport()] = true;
$this->transports[(string) $event->getMessage()->getTransport()] = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

null is anyway converted to an empty string by PHP. Let's be explicit here.

}

public function getTransports(): array
Expand All @@ -43,7 +43,7 @@ public function getEvents(string $name = null): array

$events = [];
foreach ($this->events as $event) {
if ($name === $event->getMessage()->getTransport()) {
if ($name === (string) $event->getMessage()->getTransport()) {
Copy link
Member

Choose a reason for hiding this comment

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

not sure about this one: do we support the empty string as transport name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

$events[] = $event;
}
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.