Code Duplication    Length = 13-14 lines in 2 locations

src/Event/EventLDProjector.php 1 location

@@ 610-622 (lines=13) @@
607
     * Apply the description updated event to the event repository.
608
     * @param DescriptionUpdated $descriptionUpdated
609
     */
610
    protected function applyDescriptionUpdated(
611
        DescriptionUpdated $descriptionUpdated
612
    ) {
613
        $document = $this->loadDocumentFromRepository($descriptionUpdated);
614
615
        $eventLd = $document->getBody();
616
        if (empty($eventLd->description)) {
617
            $eventLd->description = new \stdClass();
618
        }
619
        $eventLd->description->{'nl'} = $descriptionUpdated->getDescription();
620
621
        $this->repository->save($document->withBody($eventLd));
622
    }
623
624
    /**
625
     * Apply the typical age range updated event to the event repository.

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

@@ 230-243 (lines=14) @@
227
     * Apply the description updated event to the place repository.
228
     * @param DescriptionUpdated $descriptionUpdated
229
     */
230
    protected function applyDescriptionUpdated(
231
        DescriptionUpdated $descriptionUpdated
232
    ) {
233
234
        $document = $this->loadPlaceDocumentFromRepository($descriptionUpdated);
235
236
        $placeLD = $document->getBody();
237
        if (empty($placeLD->description)) {
238
            $placeLD->description = new \stdClass();
239
        }
240
        $placeLD->description->{'nl'} = $descriptionUpdated->getDescription();
241
242
        $this->repository->save($document->withBody($placeLD));
243
    }
244
245
    /**
246
     * Apply the booking info updated event to the place repository.