| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | protected function setRandomBarcodesToVariants(ProductInterface $product): void |
||
| 15 | { |
||
| 16 | static $faker; |
||
| 17 | |||
| 18 | if (null === $faker) { |
||
| 19 | $faker = \Faker\Factory::create(); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** @var ProductVariantInterface|LoevgaardBarcodeProductVariantInterface $variant */ |
||
| 23 | foreach ($product->getVariants() as $variant) { |
||
| 24 | Assert::isInstanceOf($variant, LoevgaardBarcodeProductVariantInterface::class); |
||
| 25 | |||
| 26 | $variant->setBarcode($faker->ean13); |
||
| 27 | } |
||
| 30 |