public static function extendSimpleTraceableCache(
        ContainerInterface $container,
        ?CacheInterface $cache = null
    ): ?CacheInterface {
        if ($cache !== null) {
            if ($cache instanceof PhpCachePoolInterface) {
                return new PhpCacheTraceableCacheDecorator($cache);
            }

            return new SimpleTraceableCacheDecorator($cache);
        }

        return $cache;
    }