1 | <?php |
||
24 | class UniqueCurrencyPairValidator extends ConstraintValidator |
||
25 | { |
||
26 | /** |
||
27 | * @var ExchangeRateRepositoryInterface |
||
28 | */ |
||
29 | private $exchangeRateRepository; |
||
30 | |||
31 | /** |
||
32 | * @param ExchangeRateRepositoryInterface $exchangeRateRepository |
||
33 | */ |
||
34 | public function __construct(ExchangeRateRepositoryInterface $exchangeRateRepository) |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function validate($value, Constraint $constraint) |
||
56 | |||
57 | /** |
||
58 | * @param CurrencyInterface $baseCurrency |
||
59 | * @param CurrencyInterface $targetCurrency |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | private function isCurrencyPairUnique(CurrencyInterface $baseCurrency, CurrencyInterface $targetCurrency) |
||
69 | } |
||
70 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.