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

@@ 804-818 (lines=15) @@
801
802
        $updatedMediaObjects = [];
803
804
        foreach ($eventLd->mediaObject as $mediaObject) {
805
            $mediaObjectMatches = (
806
                strpos(
807
                    $mediaObject->{'@id'},
808
                    (string)$imageUpdated->getMediaObjectId()
809
                ) > 0
810
            );
811
812
            if ($mediaObjectMatches) {
813
                $mediaObject->description = (string)$imageUpdated->getDescription();
814
                $mediaObject->copyrightHolder = (string)$imageUpdated->getCopyrightHolder();
815
816
                $updatedMediaObjects[] = $mediaObject;
817
            }
818
        };
819
820
        if (empty($updatedMediaObjects)) {
821
            throw new \Exception('The image to update could not be found.');