Code Duplication    Length = 15-15 lines in 2 locations

Command/MassMigrateCommand.php 1 location

@@ 203-217 (lines=15) @@
200
                        /** @var Migration $migration */
201
                        $migration = $migrationService->getMigration($migrationDefinition->name);
202
203
                        if (!$migration) {
204
                            // q: shall we add the migration to the db as failed? In doubt, we let it become a ghost, disappeared without a trace...
205
                            throw new \Exception("After the separate process charged to execute the migration finished, the migration can not be found in the database any more.");
206
                        } else if ($migration->status == Migration::STATUS_STARTED) {
207
                            $errorMsg = "The separate process charged to execute the migration left it in 'started' state. Most likely it died halfway through execution.";
208
                            $migrationService->endMigration(New Migration(
209
                                $migration->name,
210
                                $migration->md5,
211
                                $migration->path,
212
                                $migration->executionDate,
213
                                Migration::STATUS_FAILED,
214
                                ($migration->executionError != '' ? ($errorMsg . ' ' . $migration->executionError) : $errorMsg)
215
                            ));
216
                            throw new \Exception($errorMsg);
217
                        }
218
219
                        $executed++;
220

Command/MigrateCommand.php 1 location

@@ 157-171 (lines=15) @@
154
                    /** @var Migration $migration */
155
                    $migration = $migrationService->getMigration($migrationDefinition->name);
156
157
                    if (!$migration) {
158
                        // q: shall we add the migration to the db as failed? In doubt, we let it become a ghost, disappeared without a trace...
159
                        throw new \Exception("After the separate process charged to execute the migration finished, the migration can not be found in the database any more.");
160
                    } else if ($migration->status == Migration::STATUS_STARTED) {
161
                        $errorMsg = "The separate process charged to execute the migration left it in 'started' state. Most likely it died halfway through execution.";
162
                        $migrationService->endMigration(New Migration(
163
                            $migration->name,
164
                            $migration->md5,
165
                            $migration->path,
166
                            $migration->executionDate,
167
                            Migration::STATUS_FAILED,
168
                            ($migration->executionError != '' ? ($errorMsg . ' ' . $migration->executionError) : $errorMsg)
169
                        ));
170
                        throw new \Exception($errorMsg);
171
                    }
172
173
                    $executed++;
174