Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
32 | 2 | public function process($baseCurrencyCode, RatesConfigurationRegistryInterface $configurations, array $rates) |
|
33 | { |
||
34 | 2 | $baseCurrencyCode = CurrencyCodeUtil::clean($baseCurrencyCode); |
|
35 | |||
36 | /** |
||
37 | * @var RateInterface $rate |
||
38 | */ |
||
39 | 2 | foreach ($rates as $rate) { |
|
40 | |||
41 | 2 | if ($baseCurrencyCode !== $rate->getBaseCurrencyCode()) { |
|
42 | 1 | throw new ConfigurationException(sprintf('Invalid base currency code "%s" of rate "%s" from source "%s" is not calculated.', $rate->getBaseCurrencyCode(), $rate->getCurrencyCode(), $rate->getSourceName())); |
|
43 | } |
||
44 | } |
||
45 | |||
46 | 1 | return $rates; |
|
47 | } |
||
48 | } |
||
49 |