Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 146-151 (lines=6) @@
143
    {
144
        $this->connection->beginTransaction();
145
        try {
146
            if (!$this->streamExists($streamId)) {
147
                $stmt = $this->connection
148
                    ->prepare('INSERT INTO streams (id) VALUES (:streamId)');
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)

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

@@ 177-182 (lines=6) @@
174
    protected function appendStoredEvents($streamId, $storedEvents, $expectedVersion)
175
    {
176
        $this->connection->transactional(function() use ($streamId, $storedEvents, $expectedVersion) {
177
            if (!$this->streamExists($streamId)) {
178
                $stmt = $this->connection
179
                    ->prepare('INSERT INTO streams (id) VALUES (:streamId)');
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)