Code Duplication    Length = 15-15 lines in 2 locations

src/Event/EventLDProjector.php 1 location

@@ 766-780 (lines=15) @@
763
764
        $updatedMediaObjects = [];
765
766
        foreach ($eventLd->mediaObject as $mediaObject) {
767
            $mediaObjectMatches = (
768
                strpos(
769
                    $mediaObject->{'@id'},
770
                    (string)$imageUpdated->getMediaObjectId()
771
                ) > 0
772
            );
773
774
            if ($mediaObjectMatches) {
775
                $mediaObject->description = (string)$imageUpdated->getDescription();
776
                $mediaObject->copyrightHolder = (string)$imageUpdated->getCopyrightHolder();
777
778
                $updatedMediaObjects[] = $mediaObject;
779
            }
780
        };
781
782
        if (empty($updatedMediaObjects)) {
783
            throw new \Exception('The image to update could not be found.');

src/Place/ReadModel/JSONLD/PlaceLDProjector.php 1 location

@@ 449-463 (lines=15) @@
446
447
        $updatedMediaObjects = [];
448
449
        foreach ($placeLd->mediaObject as $mediaObject) {
450
            $mediaObjectMatches = (
451
                strpos(
452
                    $mediaObject->{'@id'},
453
                    (string)$imageUpdated->getMediaObjectId()
454
                ) > 0
455
            );
456
457
            if ($mediaObjectMatches) {
458
                $mediaObject->description = (string)$imageUpdated->getDescription();
459
                $mediaObject->copyrightHolder = (string)$imageUpdated->getCopyrightHolder();
460
461
                $updatedMediaObjects[] = $mediaObject;
462
            }
463
        };
464
465
        if (empty($updatedMediaObjects)) {
466
            throw new \Exception('The image to update could not be found.');