Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 152-164 (lines=13) @@
149
                $stmt->bindValue(':streamId', $streamId);
150
                $stmt->execute();
151
            }
152
            foreach ($storedEvents as $storedEvent) {
153
                $stmt = $this->connection->prepare(
154
                    'INSERT INTO events (stream_id, type, event, metadata, occurred_on, version)
155
                 VALUES (:streamId, :type, :event, :metadata, :occurredOn, :version)'
156
                );
157
                $stmt->bindValue(':streamId', $streamId);
158
                $stmt->bindValue(':type', $storedEvent->type());
159
                $stmt->bindValue(':event', $storedEvent->data());
160
                $stmt->bindValue(':metadata', $storedEvent->metadata());
161
                $stmt->bindValue(':occurredOn', $storedEvent->occurredOn()->format('Y-m-d H:i:s'));
162
                $stmt->bindValue(':version', $storedEvent->version());
163
                $stmt->execute();
164
            }
165
            $streamFinalVersion = $this->streamVersion($streamId);
166
            if (count($storedEvents) !== $streamFinalVersion - $expectedVersion) {
167
                throw ConcurrencyException::fromVersions(

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

@@ 183-195 (lines=13) @@
180
                $stmt->bindValue(':streamId', $streamId);
181
                $stmt->execute();
182
            }
183
            foreach ($storedEvents as $storedEvent) {
184
                $stmt = $this->connection->prepare(
185
                    'INSERT INTO events (stream_id, type, event, metadata, occurred_on, version)
186
                 VALUES (:streamId, :type, :event, :metadata, :occurredOn, :version)'
187
                );
188
                $stmt->bindValue(':streamId', $streamId);
189
                $stmt->bindValue(':type', $storedEvent->type());
190
                $stmt->bindValue(':event', $storedEvent->data());
191
                $stmt->bindValue(':metadata', $storedEvent->metadata());
192
                $stmt->bindValue(':occurredOn', $storedEvent->occurredOn()->format('Y-m-d H:i:s'));
193
                $stmt->bindValue(':version', $storedEvent->version());
194
                $stmt->execute();
195
            }
196
            $streamFinalVersion = $this->streamVersion($streamId);
197
            if (count($storedEvents) !== $streamFinalVersion - $expectedVersion) {
198
                throw ConcurrencyException::fromVersions(