| @@ 28-39 (lines=12) @@ | ||
| 25 | ; |
|
| 26 | } |
|
| 27 | ||
| 28 | public static function matchesCurrencyCodes(RateInterface $rate, $currencyCodes) |
|
| 29 | { |
|
| 30 | if (!is_array($currencyCodes)) { |
|
| 31 | $currencyCodes = array($currencyCodes); |
|
| 32 | } |
|
| 33 | ||
| 34 | if (empty($currencyCodes)) { |
|
| 35 | return true; |
|
| 36 | } |
|
| 37 | ||
| 38 | return in_array($rate->getCurrencyCode(), $currencyCodes); |
|
| 39 | } |
|
| 40 | ||
| 41 | public static function matchesSources(RateInterface $rate, $sources) |
|
| 42 | { |
|
| @@ 41-52 (lines=12) @@ | ||
| 38 | return in_array($rate->getCurrencyCode(), $currencyCodes); |
|
| 39 | } |
|
| 40 | ||
| 41 | public static function matchesSources(RateInterface $rate, $sources) |
|
| 42 | { |
|
| 43 | if (!is_array($sources)) { |
|
| 44 | $sources = array($sources); |
|
| 45 | } |
|
| 46 | ||
| 47 | if (empty($sources)) { |
|
| 48 | return true; |
|
| 49 | } |
|
| 50 | ||
| 51 | return in_array($rate->getSourceName(), $sources); |
|
| 52 | } |
|
| 53 | ||
| 54 | public static function matchesRateTypes(RateInterface $rate, $rateTypes) |
|
| 55 | { |
|
| @@ 54-65 (lines=12) @@ | ||
| 51 | return in_array($rate->getSourceName(), $sources); |
|
| 52 | } |
|
| 53 | ||
| 54 | public static function matchesRateTypes(RateInterface $rate, $rateTypes) |
|
| 55 | { |
|
| 56 | if (!is_array($rateTypes)) { |
|
| 57 | $rateTypes = array($rateTypes); |
|
| 58 | } |
|
| 59 | ||
| 60 | if (empty($rateTypes)) { |
|
| 61 | return true; |
|
| 62 | } |
|
| 63 | ||
| 64 | return in_array($rate->getRateType(), $rateTypes); |
|
| 65 | } |
|
| 66 | ||
| 67 | public static function matchesDateFrom(RateInterface $rate, \DateTime $dateFrom = null) |
|
| 68 | { |
|