| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 3 | private static function parse(array $variant): Variant |
|
| 27 | { |
||
| 28 | 3 | return Variant::create( |
|
| 29 | 3 | Uuid::fromString($variant['uuid']), |
|
| 30 | 3 | $variant['name'], |
|
| 31 | 3 | $variant['description'], |
|
| 32 | 3 | $variant['sku'], |
|
| 33 | 3 | $variant['barcode'], |
|
| 34 | 3 | (int) $variant['defaultQuantity'], |
|
| 35 | 3 | $variant['unitName'], |
|
| 36 | 3 | new Money($variant['price']['amount'], new Currency($variant['price']['currencyId'])), |
|
| 37 | 3 | $variant['costPrice'] ? new Money($variant['costPrice']['amount'], new Currency($variant['costPrice']['currencyId'])) : null, |
|
| 38 | 3 | (float) $variant['vatPercentage'] |
|
| 39 | ); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |