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
[Notifier] Fix notifier profiler when transport name is null #49326
Conversation
@@ -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; |
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.
null
is anyway converted to an empty string by PHP. Let's be explicit here.
@@ -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()) { |
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.
not sure about this one: do we support the empty string as transport name?
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.
Yes
Thank you @fabpot. |
When the transport name is
null
, the profiler is currently broken (JS error).