Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit d0f1179

Browse files
committed
Fix symfony event handler
1 parent 1327147 commit d0f1179

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Trace/Integrations/Symfony.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ public static function load()
5151
];
5252
});
5353

54-
// public function dispatch($eventName, Event $event = null)
55-
opencensus_trace_method(EventDispatcher::class, 'dispatch', function ($dispatcher, $eventName) {
54+
// public function dispatch($event/*, string $eventName = null*/);
55+
opencensus_trace_method(EventDispatcher::class, 'dispatch', function ($dispatcher, $event, $eventName = null) {
56+
if (!isset($eventName)) {
57+
$eventName = \is_object($event) ? \get_class($event) : $event;
58+
}
5659
return [
5760
'name' => $eventName,
5861
'attributes' => ['eventName' => $eventName]

0 commit comments

Comments
 (0)