| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function provide(ShippingMethodInterface $shippingMethod): BaseAdjustmentInterface |
||
| 35 | { |
||
| 36 | /** @var BaseAdjustmentInterface $adjustment */ |
||
| 37 | $adjustment = $this->adjustmentFactory->createNew(); |
||
| 38 | $adjustment->setType(AdjustmentInterface::SHIPPING_ADJUSTMENT); |
||
| 39 | $adjustment->setLabel($shippingMethod->getName()); |
||
| 40 | |||
| 41 | $channelCode = $this->channelProvider->provide()->getCode(); |
||
| 42 | $configuration = $shippingMethod->getConfiguration(); |
||
| 43 | |||
| 44 | $adjustment->setAmount((int) $configuration[$channelCode]['amount']); |
||
| 45 | |||
| 46 | return $adjustment; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |