Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | trait ProviderMockTrait |
||
12 | { |
||
13 | /** |
||
14 | * @param float $ratio |
||
15 | * @return ExchangeRateProviderInterface |
||
16 | */ |
||
17 | private function generateFakeProvider(float $ratio): ExchangeRateProviderInterface |
||
18 | { |
||
19 | return new class($ratio) implements ExchangeRateProviderInterface |
||
20 | { |
||
21 | private $ratio; |
||
22 | |||
23 | public function __construct(float $ratio) |
||
27 | |||
28 | public function getExchangeRate(CurrencyInterface $sourceCurrency, CurrencyInterface $targetCurrency, DateTimeInterface $date = null): ExchangeRateInterface |
||
35 | |||
36 | /** |
||
37 | * @return float |
||
38 | * @throws \Exception |
||
39 | */ |
||
40 | private function generateFakeRatio(): float |
||
44 | |||
45 | } |