Code Duplication    Length = 13-14 lines in 2 locations

src/ReadModel/Index/Projector.php 2 locations

@@ 197-210 (lines=14) @@
194
    /**
195
     * Listener for event created commands.
196
     */
197
    protected function applyEventCreated(EventCreated $eventCreated, DomainMessage $domainMessage)
198
    {
199
200
        $eventId = $eventCreated->getEventId();
201
202
        $metaData = $domainMessage->getMetadata()->serialize();
203
        $userId = isset($metaData['user_id']) ? $metaData['user_id'] : '';
204
205
        $location = $eventCreated->getLocation();
206
207
        $creationDate = new DateTime('now', new DateTimeZone('Europe/Brussels'));
208
209
        $this->updateIndex($eventId, EntityType::EVENT(), $userId, $eventCreated->getTitle(), $location->getPostalcode(), $creationDate);
210
    }
211
212
    /**
213
     * Listener for place created commands.
@@ 215-227 (lines=13) @@
212
    /**
213
     * Listener for place created commands.
214
     */
215
    protected function applyPlaceCreated(PlaceCreated $placeCreated, DomainMessage $domainMessage)
216
    {
217
218
        $placeId = $placeCreated->getPlaceId();
219
220
        $metaData = $domainMessage->getMetadata()->serialize();
221
        $userId = isset($metaData['user_id']) ? $metaData['user_id'] : '';
222
223
        $address = $placeCreated->getAddress();
224
225
        $creationDate = new DateTime('now', new DateTimeZone('Europe/Brussels'));
226
        $this->updateIndex($placeId, EntityType::PLACE(), $userId, $placeCreated->getTitle(), $address->getPostalcode(), $creationDate);
227
    }
228
229
    /**
230
     * Listener for organizer created commands.