public static function toPsr(CakeResponse $response)
    {
        $status = $response->statusCode();
        $headers = $response->header();
        if (!isset($headers['Content-Type'])) {
            $headers = static::setContentType($headers, $response);
        }
        $cookies = $response->cookie();
        if ($cookies) {
            $headers['Set-Cookie'] = static::buildCookieHeader($cookies);
        }
        $stream = static::getStream($response);

        return new DiactorosResponse($stream, $status, $headers);
    }
public static function toPsr(CakeResponse $response)
    {
        $status = $response->statusCode();
        $headers = $response->header();
        if (!isset($headers['Content-Type'])) {
            $headers = static::setContentType($headers, $response);
        }
        $cookies = $response->cookie();
        if ($cookies) {
            $headers['Set-Cookie'] = static::buildCookieHeader($cookies);
        }
        $stream = static::getStream($response);

        return new DiactorosResponse($stream, $status, $headers);
    }
public static function toPsr ( CakeResponse $ response ) { $ status = $ response -> statusCode ( ) ; $ headers = $ response -> header ( ) ; if ( ! isset ( $ headers [ 'Content-Type' ] ) ) { $ headers = static :: setContentType ( $ headers , $ response ) ; } $ cookies = $ response -> cookie ( ) ; if ( $ cookies ) { $ headers [ 'Set-Cookie' ] = static :: buildCookieHeader ( $ cookies ) ; } $ stream = static :: getStream ( $ response ) ; return new DiactorosResponse ( $ stream , $ status , $ headers ) ; }
Convert a CakePHP response into a PSR7 one.

@param \Cake\Http\Response $response The CakePHP response to convert
@return \Psr\Http\Message\ResponseInterface $response The equivalent PSR7 response.
Convert a CakePHP response into a PSR7 one .