Code Duplication    Length = 10-14 lines in 2 locations

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

src/Organizer/OrganizerLDProjector.php 1 location

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