public static function createDumpServer(ContainerInterface $container): DumpServer
    {
        $connection = $container->get(Connection::class);
        // @codeCoverageIgnoreStart
        VarDumper::setHandler(static function ($var) use ($connection): void {
            $data = (new VarCloner())->cloneVar($var);

            if ($connection->write($data)) {
                (new CliDumper())->dump($data);
            }
        });
        // @codeCoverageIgnoreEnd
        $logger = null;

        if ($container->has(LoggerInterface::class)) {
            $logger = $container->get(LoggerInterface::class);
        }

        $resolvedOptions = self::resolveOptions($container->get('config'));

        return new DumpServer(
            $resolvedOptions['debug_server']['host'],
            $logger
        );
    }