<commit_before><?php

namespace Zenstruck\Bundle\CacheBundle\UrlFetcher;

use Guzzle\Http\StaticClient as Guzzle;
use Symfony\Component\HttpFoundation\Response;

/**
 * @author <NAME> <<EMAIL>>
 */
class GuzzleUrlFetcher implements UrlFetcherInterface
{
    protected $params = array(
        'exceptions' => false
    );

    public function fetch($url)
    {
        $response = Guzzle::get($url, $this->params);

        return new Response($response->getBody(true), $response->getStatusCode());
    }

    public function setTimeout($seconds)
    {
        $this->params['timeout'] = $seconds;
    }

}<commit_msg>refactored GuzzleUrlFetcher<commit_after><?php

namespace Zenstruck\Bundle\CacheBundle\UrlFetcher;

use Guzzle\Http\Client;
use Symfony\Component\HttpFoundation\Response;

/**
 * @author <NAME> <<EMAIL>>
 */
class GuzzleUrlFetcher implements UrlFetcherInterface
{
    protected $client;

    public function __construct()
    {
        $this->client = new Client();
        $this->client->getConfig()->setPath('request.options/exceptions', false);
    }

    public function fetch($url)
    {
        $response = $this->client->get($url)->send();

        return new Response($response->getBody(true), $response->getStatusCode());
    }

    public function setTimeout($seconds)
    {
        $this->client->getConfig()->setPath('request.options/timeout', $seconds);
    }

}
{'fraction_non_alphanumeric': 0.1464465183058148, 'fraction_numerical': 0.0, 'mean_word_length': 3.585526315789474, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, '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': '6791300', 'n_tokens_mistral': 420, 'n_tokens_neox': 417, 'n_words': 75}