public static function prepareHeaders(ResponseInterface $response): array
    {
        $preparedHeaders = [];
        $statusHeader = rtrim(self::generateStatusLine($response), "\r\n");

        $preparedHeaders[] = $statusHeader;
        $headers = $response->getHeaders();
        if ($headers instanceof Headers) {
            $preparedHeaders = array_merge($preparedHeaders, $headers->getPreparedValues());
        } else {
            foreach (array_keys($headers) as $name) {
                $preparedHeaders[] = $response->getHeaderLine($name);
            }
        }

        return $preparedHeaders;
    }
public static function prepareHeaders(ResponseInterface $response): array
    {
        $preparedHeaders = [];
        $statusHeader = rtrim(self::generateStatusLine($response), "\r\n");

        $preparedHeaders[] = $statusHeader;
        $headers = $response->getHeaders();
        if ($headers instanceof Headers) {
            $preparedHeaders = array_merge($preparedHeaders, $headers->getPreparedValues());
        } else {
            foreach (array_keys($headers) as $name) {
                $preparedHeaders[] = $response->getHeaderLine($name);
            }
        }

        return $preparedHeaders;
    }
public static function prepareHeaders ( ResponseInterface $ response ) : array { $ preparedHeaders = [ ] ; $ statusHeader = rtrim ( self :: generateStatusLine ( $ response ) , "\r\n" ) ; $ preparedHeaders [ ] = $ statusHeader ; $ headers = $ response -> getHeaders ( ) ; if ( $ headers instanceof Headers ) { $ preparedHeaders = array_merge ( $ preparedHeaders , $ headers -> getPreparedValues ( ) ) ; } else { foreach ( array_keys ( $ headers ) as $ name ) { $ preparedHeaders [ ] = $ response -> getHeaderLine ( $ name ) ; } } return $ preparedHeaders ; }
Prepare array of header lines for this response

@param ResponseInterface $response
@return array
Prepare array of header lines for this response