| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function uploadImage(ResourceControllerEvent $event): void |
||
| 40 | { |
||
| 41 | $page = $event->getSubject(); |
||
| 42 | |||
| 43 | Assert::isInstanceOf($page, PageInterface::class); |
||
| 44 | |||
| 45 | /** @var PageTranslationInterface $translation */ |
||
| 46 | foreach ($page->getTranslations() as $translation) { |
||
| 47 | $image = $translation->getImage(); |
||
| 48 | |||
| 49 | if (null !== $image && true === $image->hasFile()) { |
||
| 50 | $this->uploader->upload($image); |
||
| 51 | } |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |
||
| 55 |