Code Duplication    Length = 9-12 lines in 4 locations

src/Organizer/OrganizerLDProjector.php 1 location

@@ 413-424 (lines=12) @@
410
     * @param string $id
411
     * @return JsonDocument
412
     */
413
    private function newDocument($id)
414
    {
415
        $document = new JsonDocument($id);
416
417
        $organizerLd = $document->getBody();
418
        $organizerLd->{'@id'} = $this->iriGenerator->iri($id);
419
        $organizerLd->{'@context'} = '/contexts/organizer';
420
421
        return $document->withBody($organizerLd);
422
    }
423
424
    /**
425
     * @param OrganizerEvent $organizerEvent
426
     * @param Title $title
427
     * @param Language|null $language

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

@@ 834-842 (lines=9) @@
831
     * @param string $id
832
     * @return JsonDocument
833
     */
834
    protected function newDocument($id)
835
    {
836
        $document = new JsonDocument($id);
837
838
        $offerLd = $document->getBody();
839
        $offerLd->{'@id'} = $this->iriGenerator->iri($id);
840
841
        return $document->withBody($offerLd);
842
    }
843
844
    /**
845
     * @param AbstractEvent $event

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

@@ 163-174 (lines=12) @@
160
     * @param string $id
161
     * @return JsonDocument
162
     */
163
    protected function newDocument($id)
164
    {
165
        $document = new JsonDocument($id);
166
167
        $placeLd = $document->getBody();
168
        $placeLd->{'@id'} = $this->iriGenerator->iri($id);
169
        $placeLd->{'@context'} = '/contexts/place';
170
171
        return $document->withBody($placeLd);
172
    }
173
174
    /**
175
     * @param PlaceCreated $placeCreated
176
     * @param DomainMessage $domainMessage
177
     * @return JsonDocument

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

@@ 140-151 (lines=12) @@
137
     * @param string $id
138
     * @return JsonDocument
139
     */
140
    protected function newDocument($id)
141
    {
142
        $document = new JsonDocument($id);
143
144
        $offerLd = $document->getBody();
145
        $offerLd->{'@id'} = $this->iriGenerator->iri($id);
146
        $offerLd->{'@context'} = '/contexts/event';
147
148
        return $document->withBody($offerLd);
149
    }
150
151
    protected function applyOrganizerProjectedToJSONLD(OrganizerProjectedToJSONLD $organizerProjectedToJSONLD)
152
    {
153
        $eventIds = $this->eventsOrganizedByOrganizer(
154
            $organizerProjectedToJSONLD->getId()