From 1d57573431de01798bb207b792eabf8bfd8345a8 Mon Sep 17 00:00:00 2001 From: Fred Cox Date: Tue, 17 Sep 2019 16:40:03 +0300 Subject: [PATCH] Fix symfony app handler --- src/Trace/Integrations/Symfony.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Trace/Integrations/Symfony.php b/src/Trace/Integrations/Symfony.php index c0b0e3a42..160bcd17f 100644 --- a/src/Trace/Integrations/Symfony.php +++ b/src/Trace/Integrations/Symfony.php @@ -51,8 +51,11 @@ public static function load() ]; }); - // public function dispatch($eventName, Event $event = null) - opencensus_trace_method(EventDispatcher::class, 'dispatch', function ($dispatcher, $eventName) { + // public function dispatch($event/*, string $eventName = null*/); + opencensus_trace_method(EventDispatcher::class, 'dispatch', function ($dispatcher, $event, $eventName = null) { + if (null === $eventName) { + $eventName = \is_object($event) ? \get_class($event) : $event; + } return [ 'name' => $eventName, 'attributes' => ['eventName' => $eventName]