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

@@ 604-614 (lines=11) @@
601
        $this->repository->save($document->withBody($eventLd));
602
    }
603
604
    protected function applyDescriptionTranslated(
605
        DescriptionTranslated $descriptionTranslated
606
    ) {
607
        $document = $this->loadDocumentFromRepository($descriptionTranslated);
608
609
        $eventLd = $document->getBody();
610
        $eventLd->description->{$descriptionTranslated->getLanguage()->getCode(
611
        )} = $descriptionTranslated->getDescription();
612
613
        $this->repository->save($document->withBody($eventLd));
614
    }
615
616
    protected function applyTranslationApplied(
617
        TranslationApplied $translationApplied
@@ 676-685 (lines=10) @@
673
     * Apply the typical age range updated event to the event repository.
674
     * @param TypicalAgeRangeUpdated $typicalAgeRangeUpdated
675
     */
676
    protected function applyTypicalAgeRangeUpdated(
677
        TypicalAgeRangeUpdated $typicalAgeRangeUpdated
678
    ) {
679
        $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);
680
681
        $eventLd = $document->getBody();
682
        $eventLd->typicalAgeRange = $typicalAgeRangeUpdated->getTypicalAgeRange();
683
684
        $this->repository->save($document->withBody($eventLd));
685
    }
686
687
    /**
688
     * Apply the typical age range deleted event to the event repository.