Code Duplication    Length = 13-13 lines in 2 locations

Command/MassMigrateCommand.php 1 location

@@ 324-336 (lines=13) @@
321
322
        // if user wants to execute 'all' migrations: look for some which are registered in the database even if not
323
        // found by the loader
324
        if (empty($paths)) {
325
            foreach ($migrations as $migration) {
326
                if ($migration->status == Migration::STATUS_TODO && !isset($toExecute[$migration->name])) {
327
                    $migrationDefinitions = $migrationService->getMigrationsDefinitions(array($migration->path));
328
                    if (count($migrationDefinitions)) {
329
                        $migrationDefinition = reset($migrationDefinitions);
330
                        $toExecute[$migration->name] = $isChild ? $migrationService->parseMigrationDefinition($migrationDefinition) : $migrationDefinition;
331
                    } else {
332
                        // q: shall we raise a warning here ?
333
                    }
334
                }
335
            }
336
        }
337
338
        ksort($toExecute);
339

Command/MigrateCommand.php 1 location

@@ 256-268 (lines=13) @@
253
254
        // if user wants to execute 'all' migrations: look for some which are registered in the database even if not
255
        // found by the loader
256
        if (empty($paths)) {
257
            foreach ($migrations as $migration) {
258
                if (in_array($migration->status, $allowedStatuses) && !isset($toExecute[$migration->name])) {
259
                    $migrationDefinitions = $migrationService->getMigrationsDefinitions(array($migration->path));
260
                    if (count($migrationDefinitions)) {
261
                        $migrationDefinition = reset($migrationDefinitions);
262
                        $toExecute[$migration->name] = $migrationService->parseMigrationDefinition($migrationDefinition);
263
                    } else {
264
                        // q: shall we raise a warning here ?
265
                    }
266
                }
267
            }
268
        }
269
270
        ksort($toExecute);
271