| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function load(ObjectManager $manager): void |
||
| 35 | { |
||
| 36 | $fs = new Filesystem(); |
||
| 37 | $finder = new Finder(); |
||
| 38 | foreach($finder->in(__DIR__ . '/gpx')->name('/\.gpx$/i') as $source) { |
||
| 39 | $targetPath = sys_get_temp_dir() . '/' . $source->getFilename(); |
||
| 40 | $fs->copy($source->getPathname(), $targetPath); |
||
| 41 | $uploadedFile = $this->uploaderHelper->uploadGpxFile(new File($targetPath)); |
||
| 42 | $wander = new Wander(); |
||
| 43 | $wander->setGpxFilename($uploadedFile); |
||
| 44 | $this->gpxService->updateWanderStatsFromGpx($wander); |
||
| 45 | $wander->setTitle('Test Wander Title for ' . $source->getFilename()); |
||
| 46 | $wander->setDescription('Test wander description for ' . $source->getFilename()); |
||
| 47 | $manager->persist($wander); |
||
| 48 | } |
||
| 49 | $manager->flush(); |
||
| 50 | } |
||
| 52 |