Code Duplication    Length = 15-15 lines in 2 locations

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.');

src/Event/EventLDProjector.php 1 location

@@ 834-848 (lines=15) @@
831
832
        $updatedMediaObjects = [];
833
834
        foreach ($eventLd->mediaObject as $mediaObject) {
835
            $mediaObjectMatches = (
836
                strpos(
837
                    $mediaObject->{'@id'},
838
                    (string)$imageUpdated->getMediaObjectId()
839
                ) > 0
840
            );
841
842
            if ($mediaObjectMatches) {
843
                $mediaObject->description = (string)$imageUpdated->getDescription();
844
                $mediaObject->copyrightHolder = (string)$imageUpdated->getCopyrightHolder();
845
846
                $updatedMediaObjects[] = $mediaObject;
847
            }
848
        };
849
850
        if (empty($updatedMediaObjects)) {
851
            throw new \Exception('The image to update could not be found.');