1 | <?php |
||
10 | final class ChainedExchangeRateProvider implements ExchangeRateProviderInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var ExchangeRateProviderInterface[] |
||
14 | */ |
||
15 | private $exchangeRateProviders = []; |
||
16 | |||
17 | /** |
||
18 | * ChainedExchangeRateProvider constructor. |
||
19 | * @param ExchangeRateProviderInterface[] $exchangeRateProviders |
||
20 | */ |
||
21 | public function __construct(array $exchangeRateProviders) |
||
27 | |||
28 | /** |
||
29 | * @inheritDoc |
||
30 | */ |
||
31 | public function getExchangeRate(CurrencyInterface $sourceCurrency, CurrencyInterface $targetCurrency, DateTimeInterface $date = null): ExchangeRateInterface |
||
42 | |||
43 | /** |
||
44 | * @param ExchangeRateProviderInterface ...$exchangeRateProviders |
||
45 | * @return ChainedExchangeRateProvider |
||
46 | */ |
||
47 | public function withProviders(ExchangeRateProviderInterface ...$exchangeRateProviders): self |
||
55 | } |
||
56 |