Code Duplication    Length = 10-11 lines in 3 locations

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

@@ 299-308 (lines=10) @@
296
     * Apply the typical age range updated event to the place repository.
297
     * @param TypicalAgeRangeUpdated $typicalAgeRangeUpdated
298
     */
299
    protected function applyTypicalAgeRangeUpdated(
300
        TypicalAgeRangeUpdated $typicalAgeRangeUpdated
301
    ) {
302
        $document = $this->loadPlaceDocumentFromRepository($typicalAgeRangeUpdated);
303
304
        $placeLd = $document->getBody();
305
        $placeLd->typicalAgeRange = $typicalAgeRangeUpdated->getTypicalAgeRange();
306
307
        $this->repository->save($document->withBody($placeLd));
308
    }
309
310
    /**
311
     * Apply the typical age range deleted event to the place repository.

src/Event/EventLDProjector.php 2 locations

@@ 634-644 (lines=11) @@
631
        $this->repository->save($document->withBody($eventLd));
632
    }
633
634
    protected function applyDescriptionTranslated(
635
        DescriptionTranslated $descriptionTranslated
636
    ) {
637
        $document = $this->loadDocumentFromRepository($descriptionTranslated);
638
639
        $eventLd = $document->getBody();
640
        $eventLd->description->{$descriptionTranslated->getLanguage()->getCode(
641
        )} = $descriptionTranslated->getDescription();
642
643
        $this->repository->save($document->withBody($eventLd));
644
    }
645
646
    protected function applyTranslationApplied(
647
        TranslationApplied $translationApplied
@@ 706-715 (lines=10) @@
703
     * Apply the typical age range updated event to the event repository.
704
     * @param TypicalAgeRangeUpdated $typicalAgeRangeUpdated
705
     */
706
    protected function applyTypicalAgeRangeUpdated(
707
        TypicalAgeRangeUpdated $typicalAgeRangeUpdated
708
    ) {
709
        $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);
710
711
        $eventLd = $document->getBody();
712
        $eventLd->typicalAgeRange = $typicalAgeRangeUpdated->getTypicalAgeRange();
713
714
        $this->repository->save($document->withBody($eventLd));
715
    }
716
717
    /**
718
     * Apply the typical age range deleted event to the event repository.