Code Duplication    Length = 9-12 lines in 4 locations

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

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

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

@@ 170-181 (lines=12) @@
167
     * @param string $id
168
     * @return JsonDocument
169
     */
170
    protected function newDocument($id)
171
    {
172
        $document = new JsonDocument($id);
173
174
        $placeLd = $document->getBody();
175
        $placeLd->{'@id'} = $this->iriGenerator->iri($id);
176
        $placeLd->{'@context'} = '/contexts/place';
177
178
        return $document->withBody($placeLd);
179
    }
180
181
    /**
182
     * @param PlaceCreated $placeCreated
183
     * @param DomainMessage $domainMessage
184
     * @return JsonDocument

src/Organizer/OrganizerLDProjector.php 1 location

@@ 423-434 (lines=12) @@
420
     * @param string $id
421
     * @return JsonDocument
422
     */
423
    private function newDocument($id)
424
    {
425
        $document = new JsonDocument($id);
426
427
        $organizerLd = $document->getBody();
428
        $organizerLd->{'@id'} = $this->iriGenerator->iri($id);
429
        $organizerLd->{'@context'} = '/contexts/organizer';
430
431
        return $document->withBody($organizerLd);
432
    }
433
434
    /**
435
     * @param OrganizerEvent $organizerEvent
436
     * @param Title $title
437
     * @param Language|null $language

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

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