src/Viserio/Component/Events/Provider/EventsDataCollectorServiceProvider.php
public static function extendEventManager(
        ContainerInterface $container,
        ?EventManager $eventManager = null
    ): ?TraceableEventManager {
        if ($eventManager !== null) {
            $options = self::resolveOptions($container->get('config'));

            if ($options['collector']['events']) {
                $eventManager = new TraceableEventManager($eventManager, $container->get(Stopwatch::class));

                if ($container->has(LoggerInterface::class)) {
                    $eventManager->setLogger($container->get(LoggerInterface::class));
                }
            }
        }

        return $eventManager;
    }
public static function extendEventManager(
        ContainerInterface $container,
        ?EventManager $eventManager = null
    ): ?TraceableEventManager {
        if ($eventManager !== null) {
            $options = self::resolveOptions($container->get('config'));

            if ($options['collector']['events']) {
                $eventManager = new TraceableEventManager($eventManager, $container->get(Stopwatch::class));

                if ($container->has(LoggerInterface::class)) {
                    $eventManager->setLogger($container->get(LoggerInterface::class));
                }
            }
        }

        return $eventManager;
    }
Extend viserio events manager with a new event.

@param \Psr\Container\ContainerInterface           $container
@param null|\Viserio\Component\Events\EventManager $eventManager

@return null|\Viserio\Component\Contract\Events\EventManager|\Viserio\Component\Events\DataCollector\TraceableEventManager