src/Leevel/Http/Psr2Leevel.php
public function createResponse(ResponseInterface $psrResponse): IResponse
    {
        $response = new Response(
            $psrResponse->getBody()->__toString(),
            $psrResponse->getStatusCode(),
            $psrResponse->getHeaders()
        );

        $response->setProtocolVersion($psrResponse->getProtocolVersion());

        foreach ($psrResponse->getHeader('Set-Cookie') as $cookie) {
            $response->setCookie(...$this->createCookie($cookie));
        }

        return $response;
    }
public function createResponse(ResponseInterface $psrResponse): IResponse
    {
        $response = new Response(
            $psrResponse->getBody()->__toString(),
            $psrResponse->getStatusCode(),
            $psrResponse->getHeaders()
        );

        $response->setProtocolVersion($psrResponse->getProtocolVersion());

        foreach ($psrResponse->getHeader('Set-Cookie') as $cookie) {
            $response->setCookie(...$this->createCookie($cookie));
        }

        return $response;
    }
从 Psr 响应对象创建 Leevel 响应对象

@param \Psr\Http\Message\ResponseInterface $psrResponse

@return \Leevel\Http\IResponse