<commit_before><?php

namespace SteffenBrand\CurrCurr\Client;

use Exception;
use GuzzleHttp\Client;
use SteffenBrand\CurrCurr\Exception\ExchangeRatesRequestFailedException;
use SteffenBrand\CurrCurr\Mapper\ExchangeRatesMapper;
use SteffenBrand\CurrCurr\Model\ExchangeRate;

class EcbClient implements EcbClientInterface
{

    /**
     * @const string
     */
    const HTTP_GET = 'GET';

    /**
     * @const string
     */
    const DEFAULT_EXCHANGE_RATES_URL = 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';

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

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

    /**
     * @param string $exchangeRatesUrl
     */
    public function __construct(string $exchangeRatesUrl = self::DEFAULT_EXCHANGE_RATES_URL)
    {
        $this->exchangeRatesUrl = $exchangeRatesUrl;
        $this->client = new Client();
    }

    /**
     * @throws ExchangeRatesRequestFailedException
     * @return ExchangeRate[]
     */
    public function getExchangeRates(): array
    {
        try {
            $response = $this->client->request(self::HTTP_GET, $this->exchangeRatesUrl);
        } catch (Exception $e) {
            throw new ExchangeRatesRequestFailedException($e);
        }

        $mapper = new ExchangeRatesMapper();
        return $mapper->map($response);
    }
<commit_msg>Update EcbClient.php<commit_after><?php

namespace SteffenBrand\CurrCurr\Client;

use Exception;
use GuzzleHttp\Client;
use SteffenBrand\CurrCurr\Exception\ExchangeRatesRequestFailedException;
use SteffenBrand\CurrCurr\Mapper\ExchangeRatesMapper;
use SteffenBrand\CurrCurr\Model\ExchangeRate;

class EcbClient implements EcbClientInterface
{

    /**
     * @const string
     */
    const HTTP_GET = 'GET';

    /**
     * @const string
     */
    const DEFAULT_EXCHANGE_RATES_URL = 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';

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

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

    /**
     * @param string $exchangeRatesUrl
     */
    public function __construct(string $exchangeRatesUrl = null)
    {
        if (null === $exchangeRatesUrl) {
            $this->exchangeRatesUrl = self::DEFAULT_EXCHANGE_RATES_URL
        } else {
            $this->exchangeRatesUrl = $exchangeRatesUrl;   
        }
        $this->client = new Client();
    }

    /**
     * @throws ExchangeRatesRequestFailedException
     * @return ExchangeRate[]
     */
    public function getExchangeRates(): array
    {
        try {
            $response = $this->client->request(self::HTTP_GET, $this->exchangeRatesUrl);
        } catch (Exception $e) {
            throw new ExchangeRatesRequestFailedException($e);
        }

        $mapper = new ExchangeRatesMapper();
        return $mapper->map($response);
    }

{'fraction_non_alphanumeric': 0.11618981158408932, 'fraction_numerical': 0.0, 'mean_word_length': 2.6337135614702154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '5653875', 'n_tokens_mistral': 921, 'n_tokens_neox': 874, 'n_words': 149}