1 | <?php |
||
25 | final class ExchangeRateContext implements Context |
||
26 | { |
||
27 | /** |
||
28 | * @var SharedStorageInterface |
||
29 | */ |
||
30 | private $sharedStorage; |
||
31 | |||
32 | /** |
||
33 | * @var FactoryInterface |
||
34 | */ |
||
35 | private $exchangeRateFactory; |
||
36 | |||
37 | /** |
||
38 | * @var ExchangeRateRepositoryInterface |
||
39 | */ |
||
40 | private $exchangeRateRepository; |
||
41 | |||
42 | /** |
||
43 | * @var ObjectManager |
||
44 | */ |
||
45 | private $entityManager; |
||
46 | |||
47 | /** |
||
48 | * @param SharedStorageInterface $sharedStorage |
||
49 | * @param FactoryInterface $exchangeRateFactory |
||
50 | * @param ExchangeRateRepositoryInterface $exchangeRateRepository |
||
51 | * @param ObjectManager $entityManager |
||
52 | */ |
||
53 | public function __construct( |
||
64 | |||
65 | /** |
||
66 | * @Given the exchange rate of :sourceCurrency to :targetCurrency is :ratio |
||
67 | */ |
||
68 | public function thereIsAnExchangeRateWithSourceCurrencyAndTargetCurrency( |
||
77 | |||
78 | /** |
||
79 | * @param CurrencyInterface $sourceCurrency |
||
80 | * @param CurrencyInterface $targetCurrency |
||
81 | * @param float $ratio |
||
82 | * |
||
83 | * @return ExchangeRateInterface |
||
84 | */ |
||
85 | private function createExchangeRate(CurrencyInterface $sourceCurrency, CurrencyInterface $targetCurrency, $ratio = 1.00) |
||
95 | |||
96 | /** |
||
97 | * @param ExchangeRateInterface $exchangeRate |
||
98 | */ |
||
99 | private function saveExchangeRate(ExchangeRateInterface $exchangeRate) |
||
104 | } |
||
105 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.