protected function prepareContentLength(ResponseInterface $response)
    {
        if (!$response->hasHeader('content-length')) {
            if ($response->getBody()->getSize() !== null) {
                return $response->withHeader('content-length', (string) $response->getBody()->getSize());
            }
        }

        return $response;
    }
protected function prepareContentLength(ResponseInterface $response)
    {
        if (!$response->hasHeader('content-length')) {
            if ($response->getBody()->getSize() !== null) {
                return $response->withHeader('content-length', (string) $response->getBody()->getSize());
            }
        }

        return $response;
    }
protected function prepareContentLength ( ResponseInterface $ response ) { if ( ! $ response -> hasHeader ( 'content-length' ) ) { if ( $ response -> getBody ( ) -> getSize ( ) !== null ) { return $ response -> withHeader ( 'content-length' , ( string ) $ response -> getBody ( ) -> getSize ( ) ) ; } } return $ response ; }
Prepare content-length header.

@param   ResponseInterface $response The response object with headers.

@return  ResponseInterface
Prepare content - length header .