Code Duplication    Length = 5-5 lines in 3 locations

Core/StorageHandler/Database/Migration.php 3 locations

@@ 280-284 (lines=5) @@
277
            // migration exists
278
279
            // fail if it was already executing or already done
280
            if ($existingMigrationData['status'] == APIMigration::STATUS_STARTED) {
281
                // commit to release the lock
282
                $conn->commit();
283
                throw new \Exception("Migration '{$migrationDefinition->name}' can not be $action as it is already executing");
284
            }
285
            if ($existingMigrationData['status'] == APIMigration::STATUS_DONE) {
286
                // commit to release the lock
287
                $conn->commit();
@@ 285-289 (lines=5) @@
282
                $conn->commit();
283
                throw new \Exception("Migration '{$migrationDefinition->name}' can not be $action as it is already executing");
284
            }
285
            if ($existingMigrationData['status'] == APIMigration::STATUS_DONE) {
286
                // commit to release the lock
287
                $conn->commit();
288
                throw new \Exception("Migration '{$migrationDefinition->name}' can not be $action as it was already executed");
289
            }
290
            if ($existingMigrationData['status'] == APIMigration::STATUS_SKIPPED) {
291
                // commit to release the lock
292
                $conn->commit();
@@ 290-294 (lines=5) @@
287
                $conn->commit();
288
                throw new \Exception("Migration '{$migrationDefinition->name}' can not be $action as it was already executed");
289
            }
290
            if ($existingMigrationData['status'] == APIMigration::STATUS_SKIPPED) {
291
                // commit to release the lock
292
                $conn->commit();
293
                throw new \Exception("Migration '{$migrationDefinition->name}' can not be $action as it was already skipped");
294
            }
295
296
            // do not set migration start date if we are skipping it
297
            $migration = new APIMigration(