Code Duplication    Length = 9-14 lines in 3 locations

src/Offer/ReadModel/JSONLD/OfferLDProjector.php 1 location

@@ 979-987 (lines=9) @@
976
     * @param string $id
977
     * @return JsonDocument
978
     */
979
    protected function newDocument($id)
980
    {
981
        $document = new JsonDocument($id);
982
983
        $offerLd = $document->getBody();
984
        $offerLd->{'@id'} = $this->iriGenerator->iri($id);
985
986
        return $document->withBody($offerLd);
987
    }
988
989
    /**
990
     * @param AbstractEvent $event

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

@@ 176-185 (lines=10) @@
173
     * @param string $id
174
     * @return JsonDocument
175
     */
176
    protected function newDocument($id)
177
    {
178
        $document = new JsonDocument($id);
179
180
        $placeLd = $document->getBody();
181
        $placeLd->{'@id'} = $this->iriGenerator->iri($id);
182
        $placeLd->{'@context'} = '/contexts/place';
183
184
        return $document->withBody($placeLd);
185
    }
186
187
    /**
188
     * @param PlaceCreated $placeCreated

src/Organizer/OrganizerLDProjector.php 1 location

@@ 433-446 (lines=14) @@
430
     * @param string $id
431
     * @return JsonDocument
432
     */
433
    private function newDocument($id)
434
    {
435
        $document = new JsonDocument($id);
436
437
        $organizerLd = $document->getBody();
438
        $organizerLd->{'@id'} = $this->iriGenerator->iri($id);
439
        $organizerLd->{'@context'} = '/contexts/organizer';
440
        // For an new organizer document set a default language of nl.
441
        // This avoids a missing language for imports.
442
        // When created with UDB3 this main language gets overwritten by the real one.
443
        $organizerLd->mainLanguage = 'nl';
444
445
        return $document->withBody($organizerLd);
446
    }
447
448
    /**
449
     * @param OrganizerEvent $organizerEvent