Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function assign(BrandInterface $brand, array $products): void |
||
16 | { |
||
17 | foreach ($products as $product) { |
||
18 | if (!$product instanceof ProductInterface) { |
||
19 | throw new \RuntimeException(sprintf( |
||
20 | "Some product was not found to assign to brand '%s'", |
||
21 | $brand->getCode() |
||
22 | )); |
||
23 | } |
||
24 | |||
25 | $brand->addProduct($product); |
||
26 | } |
||
29 |