| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | final class MollieAmountRestrictionResolver implements MollieAmountRestrictionResolverInterface |
||
| 19 | { |
||
| 20 | public function resolve(MollieGatewayConfigInterface $paymentMethod, array $methods, OrderInterface $order): array |
||
| 21 | { |
||
| 22 | if ($order->getTotal() < $paymentMethod->getMinimumAmount() || |
||
| 23 | $order->getTotal() > $paymentMethod->getMaximumAmount()) { |
||
| 24 | return $this->removePaymentMethod($paymentMethod, $methods); |
||
| 25 | } |
||
| 26 | return $methods; |
||
| 27 | } |
||
| 28 | |||
| 29 | private function removePaymentMethod(MollieGatewayConfigInterface $paymentMethod, array $methods): array |
||
| 39 | } |
||
| 40 | } |
||
| 41 |