Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function process($baseCurrencyCode, array $rateConfigurations, array $rates) |
||
19 | { |
||
20 | if (!CurrencyCode::exists($baseCurrencyCode)) { |
||
21 | throw new \RuntimeException(sprintf('Unknown base currency code "%s".', $baseCurrencyCode)); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @var RateInterface $rate |
||
26 | */ |
||
27 | foreach ($rates as $rate) { |
||
28 | |||
29 | if ($baseCurrencyCode !== $rate->getBaseCurrencyCode()) { |
||
30 | throw new ConfigurationException(sprintf('Conversion of compound rate "%s" from source "%s" is not calculated.', $rate->getCurrencyCode(), $rate->getSourceName())); |
||
31 | } |
||
32 | } |
||
33 | |||
34 | return $rates; |
||
35 | } |
||
36 | } |