| Conditions | 7 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function validate($rate, Constraint $constraint) |
||
| 27 | { |
||
| 28 | if ($rate->getCurrencyCode() && $rate->getRateType()) { |
||
| 29 | /** |
||
| 30 | * @var Configuration $rateConfiguration |
||
| 31 | */ |
||
| 32 | foreach ($this->ratesConfiguration as $rateConfiguration) { |
||
| 33 | |||
| 34 | if ( |
||
| 35 | $rateConfiguration->getRateType() === $rate->getRateType() |
||
| 36 | && |
||
| 37 | $rateConfiguration->getCurrencyCode() === $rate->getCurrencyCode() |
||
| 38 | && |
||
| 39 | $rateConfiguration->getSource() === $rate->getSourceName() |
||
| 40 | ) { |
||
| 41 | return; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | /** |
||
| 45 | * @var ExchangeRate $constraint |
||
| 46 | */ |
||
| 47 | $this->context->buildViolation($constraint->message) |
||
| 48 | ->addViolation(); |
||
| 49 | } |
||
| 50 | } |
||
| 51 | } |
||
| 52 |