Code Duplication    Length = 10-14 lines in 2 locations

src/Organizer/OrganizerLDProjector.php 1 location

@@ 433-446 (lines=14) @@
430
     * @param string $id
431
     * @return JsonDocument
432
     */
433
    private function newDocument($id)
434
    {
435
        $document = new JsonDocument($id);
436
437
        $organizerLd = $document->getBody();
438
        $organizerLd->{'@id'} = $this->iriGenerator->iri($id);
439
        $organizerLd->{'@context'} = '/contexts/organizer';
440
        // For an new organizer document set a default language of nl.
441
        // This avoids a missing language for imports.
442
        // When created with UDB3 this main language gets overwritten by the real one.
443
        $organizerLd->mainLanguage = 'nl';
444
445
        return $document->withBody($organizerLd);
446
    }
447
448
    /**
449
     * @param OrganizerEvent $organizerEvent

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

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