Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | public function assign(TaxonAwareInterface $taxonAware, array $taxonCodes): void |
||
29 | { |
||
30 | foreach ($taxonCodes as $taxonCode) { |
||
31 | /** @var TaxonInterface|null $taxon */ |
||
32 | $taxon = $this->taxonRepository->findOneBy(['code' => $taxonCode]); |
||
33 | |||
34 | Assert::notNull($taxon, sprintf('Taxon with %s code not found.', $taxonCode)); |
||
35 | $taxonAware->addTaxon($taxon); |
||
|
|||
36 | } |
||
39 |