Code Duplication    Length = 9-9 lines in 2 locations

src/EventSourcing/EventStore/Vendor/DoctrineDbalEventStore.php 1 location

@@ 204-212 (lines=9) @@
201
                'INSERT INTO events (stream_id, type, event, metadata, occurred_on, version)
202
                 VALUES (:streamId, :type, :event, :metadata, :occurredOn, :version)'
203
            );
204
            foreach ($storedEvents as $storedEvent) {
205
                $stmt->bindValue(':streamId', $streamId);
206
                $stmt->bindValue(':type', $storedEvent->type());
207
                $stmt->bindValue(':event', $storedEvent->data());
208
                $stmt->bindValue(':metadata', $storedEvent->metadata());
209
                $stmt->bindValue(':occurredOn', $storedEvent->occurredOn()->format('Y-m-d H:i:s'));
210
                $stmt->bindValue(':version', $storedEvent->version());
211
                $stmt->execute();
212
            }
213
214
            if ($expectedVersion !== self::EXPECTED_VERSION_ANY) {
215
                $streamFinalVersion = $this->streamVersion($streamId);

src/EventSourcing/EventStore/Vendor/MySqlJsonEventStore.php 1 location

@@ 174-182 (lines=9) @@
171
                'INSERT INTO events (stream_id, type, event, metadata, occurred_on, version)
172
                 VALUES (:streamId, :type, :event, :metadata, :occurredOn, :version)'
173
            );
174
            foreach ($storedEvents as $storedEvent) {
175
                $stmt->bindValue(':streamId', $streamId);
176
                $stmt->bindValue(':type', $storedEvent->type());
177
                $stmt->bindValue(':event', $storedEvent->data());
178
                $stmt->bindValue(':metadata', $storedEvent->metadata());
179
                $stmt->bindValue(':occurredOn', $storedEvent->occurredOn()->format('Y-m-d H:i:s'));
180
                $stmt->bindValue(':version', $storedEvent->version());
181
                $stmt->execute();
182
            }
183
184
            if ($expectedVersion !== self::EXPECTED_VERSION_ANY) {
185
                $streamFinalVersion = $this->streamVersion($streamId);