src/Viserio/Component/WebServer/Command/ServerDumpCommand.php
public function handle(): int
    {
        $format     = $this->option('format');
        $output     = $this->getOutput();

        if (! $descriptor = $this->descriptors[$format] ?? null) {
            throw new RuntimeException(\sprintf('Unsupported format [%s].', $format));
        }

        $this->error('Symfony Var Dumper Server');

        $this->server->start();

        $output->success(\sprintf('Server listening on %s', $this->server->getHost()));

        $this->comment('Quit the server with CONTROL-C.');

        $this->server->listen(static function (Data $data, array $context, int $clientId) use ($descriptor, $output): void {
            $descriptor->describe($output, $data, $context, $clientId);
        });

        return 0;
    }
public function handle(): int
    {
        $format     = $this->option('format');
        $output     = $this->getOutput();

        if (! $descriptor = $this->descriptors[$format] ?? null) {
            throw new RuntimeException(\sprintf('Unsupported format [%s].', $format));
        }

        $this->error('Symfony Var Dumper Server');

        $this->server->start();

        $output->success(\sprintf('Server listening on %s', $this->server->getHost()));

        $this->comment('Quit the server with CONTROL-C.');

        $this->server->listen(static function (Data $data, array $context, int $clientId) use ($descriptor, $output): void {
            $descriptor->describe($output, $data, $context, $clientId);
        });

        return 0;
    }
{@inheritdoc}