Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | public function resolve(OrderItemInterface $item): string |
||
20 | { |
||
21 | if ($this->variantBased) { |
||
22 | $variant = $item->getVariant(); |
||
23 | if (null === $variant) { |
||
24 | return ''; |
||
25 | } |
||
26 | |||
27 | return (string) $variant->getCode(); |
||
28 | } |
||
29 | |||
30 | $product = $item->getProduct(); |
||
31 | if (null === $product) { |
||
32 | return ''; |
||
33 | } |
||
34 | |||
35 | return (string) $product->getCode(); |
||
36 | } |
||
38 |