original_string: public static function instance_from_curl($ch, $body) {
  		$transfer_info = curl_getinfo($ch);
  		$statuscode = (!empty($transfer_info['http_code'])) ? (int)$transfer_info['http_code'] : 404;
  		$errors = [];
  
  		$err = static::decode_error_code(curl_errno($ch));
  		if ($err !== 'SUCCESS') {
  			$errors[] = $err;
  		}
  
  		$mime = (!empty($transfer_info['content_type'])) ? $transfer_info['content_type'] : 'text/plain';
  
  		return new HttpClientResponse($statuscode, $mime, $body, $errors);
  	}
code: public static function instance_from_curl($ch, $body) {
  		$transfer_info = curl_getinfo($ch);
  		$statuscode = (!empty($transfer_info['http_code'])) ? (int)$transfer_info['http_code'] : 404;
  		$errors = [];
  
  		$err = static::decode_error_code(curl_errno($ch));
  		if ($err !== 'SUCCESS') {
  			$errors[] = $err;
  		}
  
  		$mime = (!empty($transfer_info['content_type'])) ? $transfer_info['content_type'] : 'text/plain';
  
  		return new HttpClientResponse($statuscode, $mime, $body, $errors);
  	}
code_tokens: public static function instance_from_curl ( $ ch , $ body ) { $ transfer_info = curl_getinfo ( $ ch ) ; $ statuscode = ( ! empty ( $ transfer_info [ 'http_code' ] ) ) ? ( int ) $ transfer_info [ 'http_code' ] : 404 ; $ errors = [ ] ; $ err = static :: decode_error_code ( curl_errno ( $ ch ) ) ; if ( $ err !== 'SUCCESS' ) { $ errors [ ] = $ err ; } $ mime = ( ! empty ( $ transfer_info [ 'content_type' ] ) ) ? $ transfer_info [ 'content_type' ] : 'text/plain' ; return new HttpClientResponse ( $ statuscode , $ mime , $ body , $ errors ) ; }
docstring: Create an instance from a curl handle and body.
  
  @param resource $ch An active curl handle.
  @param string $body The returned body.
  @return HttpClientResponse A response object.
docstring_tokens: Create an instance from a curl handle and body .