<commit_before><?php

namespace Osm\MetricCollector\HttpClient;

use Osm\MetricCollector\HttpClientInterface;
use Osm\MetricCollector\Exception\HttpResponseException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\TransferException;

/**
 * Sends Http requests over Guzzle client.
 */
class GuzzleHttpClient implements HttpClientInterface
{

    /**
     * @var Client
     */
    private $httpClient;

    /**
     *
     * @var array
     */
    private $authentication;

    /**
     *
     * @var array
     */
    private $certificate;

    /**
     *
     * @var boolean|string
     */
    private $verifyCertificate;

    /**
     *
     * @var float
     */
    private $connectTimeout = 2;

    /**
     *
     * @var float
     */
    private $timeout = 5;

    /**
     *
     * @var array
     */
    private $headers;

    /**
     *
     * @var string
     */
    private $proxy;

    /**
     * Initializes GuzzleHttpClient
     *
     * @param Client $httpClient
     */
    public function __construct(Client $httpClient)
    {
        $this->httpClient = $httpClient;
    }

    /**
     * {@inheritdoc}
     */
    public function send($url)
    {
        $options = array(
            'headers' => $this->headers,
            'auth' => $this->authentication,
            'timeout' => $this->timeout,
            'connect_timeout' => $this->connectTimeout,
            'verify' => $this->verifyCertificate,
            'cert' => $this->certificate,
            'proxy' => $this->proxy
        );

        try {
            return $this->httpClient->get($url, $options)->getBody(true);
        } catch (TransferException $exception) {
            throw new HttpResponseException($exception->getMessage(), $exception->getCode());
        }<commit_msg>Fixes for curl options in GuzzleHttpClient<commit_after><?php

namespace Osm\MetricCollector\HttpClient;

use Osm\MetricCollector\HttpClientInterface;
use Osm\MetricCollector\Exception\HttpResponseException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\TransferException;

/**
 * Sends Http requests over Guzzle client.
 */
class GuzzleHttpClient implements HttpClientInterface
{

    /**
     * @var Client
     */
    private $httpClient;

    /**
     *
     * @var array
     */
    private $authentication;

    /**
     *
     * @var array
     */
    private $certificate;

    /**
     *
     * @var boolean|string
     */
    private $verifyCertificate = true;

    /**
     *
     * @var float
     */
    private $connectTimeout = 2;

    /**
     *
     * @var float
     */
    private $timeout = 5;

    /**
     *
     * @var array
     */
    private $headers = array();

    /**
     *
     * @var string
     */
    private $proxy;

    /**
     * Initializes GuzzleHttpClient
     *
     * @param Client $httpClient
     */
    public function __construct(Client $httpClient)
    {
        $this->httpClient = $httpClient;
    }

    /**
     * {@inheritdoc}
     */
    public function send($url)
    {
        $options = array(
            'headers' => $this->headers,
            'auth' => $this->authentication,
            'timeout' => $this->timeout,
            'connect_timeout' => $this->connectTimeout,
            'verify' => $this->verifyCertificate
        );

        if ($this->certificate) {
            $options['cert'] = $this->certificate;
        }

        if ($this->proxy) {
            $options['proxy'] = $this->proxy;
        }

        try {
            return $this->httpClient->get($url, $options)->getBody(true);
        } catch (TransferException $exception) {
            throw new HttpResponseException($exception->getMessage(), $exception->getCode());
        }
{'fraction_non_alphanumeric': 0.13619099294628323, 'fraction_numerical': 0.0010851871947911015, 'mean_word_length': 1.88046875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3104794', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1057, 'n_words': 205}