Help with Request ID decorator - mezzio swoole

I’m trying to implement example from URL

Did anyone try this example?

Hello,

I fixed the problem myself.
below are the lines from website and the working one:

        return static fn (SwooleHttpRequest $swooleRequest): ServerRequestInterface => $factory($swooleRequest)
            ->withHeader('X-Request-ID', Uuid::uuid1());
        return static fn (SwooleHttpRequest $swooleRequest): ServerRequestInterface => ($factory())($swooleRequest)
                        ->withHeader('X-Request-ID', (string)Uuid::uuid1());