| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function modify(OrderInterface $cart, ShippingMethodInterface $shippingMethod): void |
||
| 24 | { |
||
| 25 | Assert::lessThanEq($cart->getShipments()->count(), 1, sprintf('More than one shipment is currently unsupported.')); |
||
| 26 | |||
| 27 | /** @var ShipmentInterface $shipment */ |
||
| 28 | $shipment = $cart->getShipments()->first(); |
||
| 29 | |||
| 30 | $shipment->setState(Shipment::STATE_CART); |
||
| 31 | $shipment->setMethod($shippingMethod); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |