@@ 44-49 (lines=6) @@ | ||
41 | */ |
|
42 | foreach ($rates as $rate) { |
|
43 | ||
44 | if ($baseCurrencyCode !== $rate->getBaseCurrencyCode()) { |
|
45 | $message = sprintf('Invalid base currency code "%s" of rate "%s" from source "%s" is not calculated.', $rate->getBaseCurrencyCode(), $rate->getCurrencyCode(), $rate->getSourceName()); |
|
46 | ||
47 | $this->getLogger()->critical($message); |
|
48 | throw new ConfigurationException($message); |
|
49 | } |
|
50 | } |
|
51 | ||
52 | return $rates; |
@@ 48-53 (lines=6) @@ | ||
45 | ||
46 | $key = sprintf('%s_%s_%s_%s', $rate->getCurrencyCode(), $rate->getRateType(), $rate->getSourceName(), $rate->getDate()->format('Y-m-d')); |
|
47 | ||
48 | if (array_key_exists($key, $registry)) { |
|
49 | $message = sprintf('Currency code "%s" of rate type "%s" from source "%s" valid on date "%s" is duplicated.', $rate->getCurrencyCode(), $rate->getRateType(), $rate->getSourceName(), $rate->getDate()->format('Y-m-d')); |
|
50 | ||
51 | $this->getLogger()->critical($message); |
|
52 | throw new ConfigurationException($message); |
|
53 | } |
|
54 | ||
55 | $registry[$key] = $rate->getSourceName(); |
|
56 | } |