Code Duplication    Length = 9-12 lines in 4 locations

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

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

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