Code Duplication    Length = 9-10 lines in 4 locations

src/Organizer/OrganizerLDProjector.php 1 location

@@ 421-430 (lines=10) @@
418
     * @param string $id
419
     * @return JsonDocument
420
     */
421
    private function newDocument($id)
422
    {
423
        $document = new JsonDocument($id);
424
425
        $organizerLd = $document->getBody();
426
        $organizerLd->{'@id'} = $this->iriGenerator->iri($id);
427
        $organizerLd->{'@context'} = '/contexts/organizer';
428
429
        return $document->withBody($organizerLd);
430
    }
431
432
    /**
433
     * @param OrganizerEvent $organizerEvent

src/Event/ReadModel/JSONLD/EventLDProjector.php 1 location

@@ 152-161 (lines=10) @@
149
     * @param string $id
150
     * @return JsonDocument
151
     */
152
    protected function newDocument($id)
153
    {
154
        $document = new JsonDocument($id);
155
156
        $offerLd = $document->getBody();
157
        $offerLd->{'@id'} = $this->iriGenerator->iri($id);
158
        $offerLd->{'@context'} = '/contexts/event';
159
160
        return $document->withBody($offerLd);
161
    }
162
163
    protected function applyOrganizerProjectedToJSONLD(OrganizerProjectedToJSONLD $organizerProjectedToJSONLD)
164
    {

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

@@ 993-1001 (lines=9) @@
990
     * @param string $id
991
     * @return JsonDocument
992
     */
993
    protected function newDocument($id)
994
    {
995
        $document = new JsonDocument($id);
996
997
        $offerLd = $document->getBody();
998
        $offerLd->{'@id'} = $this->iriGenerator->iri($id);
999
1000
        return $document->withBody($offerLd);
1001
    }
1002
1003
    /**
1004
     * @param AbstractEvent $event

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

@@ 191-200 (lines=10) @@
188
     * @param string $id
189
     * @return JsonDocument
190
     */
191
    protected function newDocument($id)
192
    {
193
        $document = new JsonDocument($id);
194
195
        $placeLd = $document->getBody();
196
        $placeLd->{'@id'} = $this->iriGenerator->iri($id);
197
        $placeLd->{'@context'} = '/contexts/place';
198
199
        return $document->withBody($placeLd);
200
    }
201
202
    /**
203
     * @param PlaceCreated $placeCreated