Code Duplication    Length = 10-11 lines in 3 locations

src/Event/EventLDProjector.php 2 locations

@@ 566-576 (lines=11) @@
563
        $this->repository->save($document->withBody($eventLd));
564
    }
565
566
    protected function applyDescriptionTranslated(
567
        DescriptionTranslated $descriptionTranslated
568
    ) {
569
        $document = $this->loadDocumentFromRepository($descriptionTranslated);
570
571
        $eventLd = $document->getBody();
572
        $eventLd->description->{$descriptionTranslated->getLanguage()->getCode(
573
        )} = $descriptionTranslated->getDescription();
574
575
        $this->repository->save($document->withBody($eventLd));
576
    }
577
578
    protected function applyTranslationApplied(
579
        TranslationApplied $translationApplied
@@ 638-647 (lines=10) @@
635
     * Apply the typical age range updated event to the event repository.
636
     * @param TypicalAgeRangeUpdated $typicalAgeRangeUpdated
637
     */
638
    protected function applyTypicalAgeRangeUpdated(
639
        TypicalAgeRangeUpdated $typicalAgeRangeUpdated
640
    ) {
641
        $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);
642
643
        $eventLd = $document->getBody();
644
        $eventLd->typicalAgeRange = $typicalAgeRangeUpdated->getTypicalAgeRange();
645
646
        $this->repository->save($document->withBody($eventLd));
647
    }
648
649
    /**
650
     * Apply the typical age range deleted event to the event repository.

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.