| Total Complexity | 6 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 13 | class AddAssociationEntitiesModifier implements FixtureEntitiesModifierInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var TestEntityGeneratorFactory |
||
| 17 | */ |
||
| 18 | private $testEntityGeneratorFactory; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var TestEntityGenerator |
||
| 22 | */ |
||
| 23 | private $testEntityGenerator; |
||
| 24 | |||
| 25 | public function __construct(TestEntityGeneratorFactory $testEntityGeneratorFactory) |
||
| 26 | { |
||
| 27 | $this->testEntityGeneratorFactory = $testEntityGeneratorFactory; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function modifyEntities(array &$entities): void |
||
| 31 | { |
||
| 32 | foreach ($entities as $entity) { |
||
| 33 | $this->addAssociationEntities($entity); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | private function addAssociationEntities(EntityInterface $entity): void |
||
| 38 | { |
||
| 39 | $this->getTestEntityGeneratorForEntity($entity)->addAssociationEntities($entity); |
||
| 40 | } |
||
| 41 | |||
| 42 | private function getTestEntityGeneratorForEntity(EntityInterface $entity): TestEntityGenerator |
||
| 52 | } |
||
| 53 | } |
||
| 54 |