Code Duplication    Length = 9-10 lines in 4 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/Organizer/OrganizerLDProjector.php 1 location

@@ 428-437 (lines=10) @@
425
     * @param string $id
426
     * @return JsonDocument
427
     */
428
    private function newDocument($id)
429
    {
430
        $document = new JsonDocument($id);
431
432
        $organizerLd = $document->getBody();
433
        $organizerLd->{'@id'} = $this->iriGenerator->iri($id);
434
        $organizerLd->{'@context'} = '/contexts/organizer';
435
436
        return $document->withBody($organizerLd);
437
    }
438
439
    /**
440
     * @param OrganizerEvent $organizerEvent

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

@@ 137-146 (lines=10) @@
134
     * @param string $id
135
     * @return JsonDocument
136
     */
137
    protected function newDocument($id)
138
    {
139
        $document = new JsonDocument($id);
140
141
        $offerLd = $document->getBody();
142
        $offerLd->{'@id'} = $this->iriGenerator->iri($id);
143
        $offerLd->{'@context'} = '/contexts/event';
144
145
        return $document->withBody($offerLd);
146
    }
147
148
    /**
149
     * @param EventImportedFromUDB2 $eventImportedFromUDB2

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

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