Code Duplication    Length = 10-14 lines in 2 locations

src/Organizer/OrganizerLDProjector.php 1 location

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

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

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