| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function create(ShipmentInterface $shipment, string $locale): ShippingMethodView |
||
| 23 | { |
||
| 24 | $shippingMethod = $shipment->getMethod(); |
||
| 25 | Assert::notNull($shippingMethod); |
||
| 26 | |||
| 27 | $translation = $shippingMethod->getTranslation($locale); |
||
| 28 | |||
| 29 | /** @var ShippingMethodView $shippingMethodView */ |
||
| 30 | $shippingMethodView = new $this->shippingMethodViewClass(); |
||
| 31 | $shippingMethodView->code = $shippingMethod->getCode(); |
||
| 32 | $shippingMethodView->name = $translation->getName(); |
||
|
|
|||
| 33 | $shippingMethodView->description = $translation->getDescription(); |
||
| 34 | |||
| 35 | return $shippingMethodView; |
||
| 36 | } |
||
| 38 |