src/Viserio/Component/Profiler/Provider/ProfilerPsr6Psr16CacheBridgeServiceProvider.php
public static function extendProfiler(
        ContainerInterface $container,
        ?ProfilerContract $profiler = null
    ): ?ProfilerContract {
        if ($profiler !== null) {
            $collector = new Psr6Psr16CacheDataCollector();

            if ($container->has(CacheItemPoolInterface::class)) {
                if (($cache = $container->get(CacheItemPoolInterface::class)) instanceof TraceableCacheItemDecorator) {
                    $collector->addPool($cache);
                }
            }

            if ($container->has(CacheInterface::class)) {
                $cache = $container->get(CacheInterface::class);

                if ($cache instanceof SimpleTraceableCacheDecorator || $cache instanceof PhpCacheTraceableCacheDecorator) {
                    $collector->addPool($cache);
                }
            }

            $profiler->addCollector($collector);
        }

        return $profiler;
    }
public static function extendProfiler(
        ContainerInterface $container,
        ?ProfilerContract $profiler = null
    ): ?ProfilerContract {
        if ($profiler !== null) {
            $collector = new Psr6Psr16CacheDataCollector();

            if ($container->has(CacheItemPoolInterface::class)) {
                if (($cache = $container->get(CacheItemPoolInterface::class)) instanceof TraceableCacheItemDecorator) {
                    $collector->addPool($cache);
                }
            }

            if ($container->has(CacheInterface::class)) {
                $cache = $container->get(CacheInterface::class);

                if ($cache instanceof SimpleTraceableCacheDecorator || $cache instanceof PhpCacheTraceableCacheDecorator) {
                    $collector->addPool($cache);
                }
            }

            $profiler->addCollector($collector);
        }

        return $profiler;
    }
Extend viserio profiler with data collector.

@param \Psr\Container\ContainerInterface                  $container
@param null|\Viserio\Component\Contract\Profiler\Profiler $profiler

@return null|\Viserio\Component\Contract\Profiler\Profiler