original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: 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.
docstring_tokens: Convert a CakePHP response into a PSR7 one .