| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class MetroFixtures extends Fixture implements DependentFixtureInterface |
||
| 13 | { |
||
| 14 | public function load(ObjectManager $manager): void |
||
| 15 | { |
||
| 16 | foreach ($this->getMetroData() as [$city, $name, $slug]) { |
||
| 17 | $metro = new Metro(); |
||
| 18 | $metro->setCity($city); |
||
| 19 | $metro->setName($name); |
||
| 20 | $metro->setSlug($slug); |
||
| 21 | $manager->persist($metro); |
||
| 22 | $this->addReference($name, $metro); |
||
| 23 | } |
||
| 24 | $manager->flush(); |
||
| 25 | } |
||
| 26 | |||
| 27 | private function getMetroData(): array |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function getDependencies() |
||
| 45 |