public function fetch($sourceName = null, \DateTime $date = null)
    {
        try {
            $rates = $this->manager->fetch($sourceName, $date);
        } catch (\Exception $e) {
            $this->logger->error('Unable to fetch rates from source {source} on {date}.', [
                'source' => $sourceName,
                'date' => (null === $date) ? date('Y-m-d') : $date->format('Y-m-d'),
                'exception' => $e,
            ]);
            throw $e;
        }

        /**
         * @var RateInterface $rate
         */
        foreach ($rates as $rate) {
            $this->logger->debug('Fetched rate for {currency_code} of type {rate_type} from source {source} on {date}.', [
                'currency_code' => $rate->getCurrencyCode(),
                'rate_type' => $rate->getRateType(),
                'source' => $rate->getSourceName(),
                'date' => $rate->getDate()->format('Y-m-d'),
            ]);
        }

        return $rates;
    }
public function fetch($sourceName = null, \DateTime $date = null)
    {
        try {
            $rates = $this->manager->fetch($sourceName, $date);
        } catch (\Exception $e) {
            $this->logger->error('Unable to fetch rates from source {source} on {date}.', [
                'source' => $sourceName,
                'date' => (null === $date) ? date('Y-m-d') : $date->format('Y-m-d'),
                'exception' => $e,
            ]);
            throw $e;
        }

        /**
         * @var RateInterface $rate
         */
        foreach ($rates as $rate) {
            $this->logger->debug('Fetched rate for {currency_code} of type {rate_type} from source {source} on {date}.', [
                'currency_code' => $rate->getCurrencyCode(),
                'rate_type' => $rate->getRateType(),
                'source' => $rate->getSourceName(),
                'date' => $rate->getDate()->format('Y-m-d'),
            ]);
        }

        return $rates;
    }
{@inheritdoc}