src/Chiron/Support/Http/Serializer.php
public static function responseToString(ResponseInterface $response): string
    {
        $reasonPhrase = $response->getReasonPhrase();
        $headers = self::serializeHeaders($response->getHeaders());
        $body = (string) $response->getBody();
        $format = 'HTTP/%s %d%s%s%s';
        if (! empty($headers)) {
            $headers = self::EOL . $headers;
        }
        $headers .= self::EOL . self::EOL;

        return sprintf(
            $format,
            $response->getProtocolVersion(),
            $response->getStatusCode(),
            ($reasonPhrase ? ' ' . $reasonPhrase : ''),
            $headers,
            $body
        );
    }
public static function responseToString(ResponseInterface $response): string
    {
        $reasonPhrase = $response->getReasonPhrase();
        $headers = self::serializeHeaders($response->getHeaders());
        $body = (string) $response->getBody();
        $format = 'HTTP/%s %d%s%s%s';
        if (! empty($headers)) {
            $headers = self::EOL . $headers;
        }
        $headers .= self::EOL . self::EOL;

        return sprintf(
            $format,
            $response->getProtocolVersion(),
            $response->getStatusCode(),
            ($reasonPhrase ? ' ' . $reasonPhrase : ''),
            $headers,
            $body
        );
    }
public static function responseToString ( ResponseInterface $ response ) : string { $ reasonPhrase = $ response -> getReasonPhrase ( ) ; $ headers = self :: serializeHeaders ( $ response -> getHeaders ( ) ) ; $ body = ( string ) $ response -> getBody ( ) ; $ format = 'HTTP/%s %d%s%s%s' ; if ( ! empty ( $ headers ) ) { $ headers = self :: EOL . $ headers ; } $ headers .= self :: EOL . self :: EOL ; return sprintf ( $ format , $ response -> getProtocolVersion ( ) , $ response -> getStatusCode ( ) , ( $ reasonPhrase ? ' ' . $ reasonPhrase : '' ) , $ headers , $ body ) ; }
Create a string representation of a response.

@param ResponseInterface $response

@return string
Create a string representation of a response .