Code Duplication    Length = 19-20 lines in 2 locations

src/ReadModel/Index/Projector.php 2 locations

@@ 292-311 (lines=20) @@
289
     * @param EventCreated $eventCreated
290
     * @param DomainMessage $domainMessage
291
     */
292
    protected function applyEventCreated(EventCreated $eventCreated, DomainMessage $domainMessage)
293
    {
294
        $eventId = $eventCreated->getEventId();
295
296
        $userId = $this->getUserId($domainMessage);
297
298
        $location = $eventCreated->getLocation();
299
300
        $creationDate = new DateTime('now', new DateTimeZone('Europe/Brussels'));
301
302
        $this->updateIndex(
303
            $eventId,
304
            EntityType::EVENT(),
305
            $userId,
306
            $eventCreated->getTitle(),
307
            $location->getAddress()->getPostalCode(),
308
            $this->localDomain,
309
            $creationDate
310
        );
311
    }
312
313
    /**
314
     * @param EventCopied $eventCopied
@@ 341-359 (lines=19) @@
338
     * @param PlaceCreated $placeCreated
339
     * @param DomainMessage $domainMessage
340
     */
341
    protected function applyPlaceCreated(PlaceCreated $placeCreated, DomainMessage $domainMessage)
342
    {
343
        $placeId = $placeCreated->getPlaceId();
344
345
        $userId = $this->getUserId($domainMessage);
346
347
        $address = $placeCreated->getAddress();
348
349
        $creationDate = new DateTime('now', new DateTimeZone('Europe/Brussels'));
350
        $this->updateIndex(
351
            $placeId,
352
            EntityType::PLACE(),
353
            $userId,
354
            $placeCreated->getTitle(),
355
            $address->getPostalCode(),
356
            $this->localDomain,
357
            $creationDate
358
        );
359
    }
360
361
    /**
362
     * @param $dateString