Code Duplication    Length = 19-20 lines in 2 locations

Command/MassMigrateCommand.php 1 location

@@ 394-413 (lines=20) @@
391
            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
392
    }
393
394
    protected function askForConfirmation(InputInterface $input, OutputInterface $output)
395
    {
396
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
397
            $dialog = $this->getHelperSet()->get('question');
398
            if (!$dialog->ask(
399
                $input,
400
                $output,
401
                new ConfirmationQuestion('<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>', false)
402
            )
403
            ) {
404
                $output->writeln('<error>Migration execution cancelled!</error>');
405
                return 0;
406
            }
407
        } else {
408
            // this line is not that nice in the automated scenarios used by the parallel migration
409
            //$this->writeln("=============================================");
410
        }
411
412
        return 1;
413
    }
414
415
    /**
416
     * @param MigrationDefinition[] $toExecute

Command/MigrateCommand.php 1 location

@@ 317-335 (lines=19) @@
314
        $this->writeln('');
315
    }
316
317
    protected function askForConfirmation(InputInterface $input, OutputInterface $output)
318
    {
319
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
320
            $dialog = $this->getHelperSet()->get('question');
321
            if (!$dialog->ask(
322
                $input,
323
                $output,
324
                new ConfirmationQuestion('<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>', false)
325
            )
326
            ) {
327
                $output->writeln('<error>Migration execution cancelled!</error>');
328
                return 0;
329
            }
330
        } else {
331
            $this->writeln("=============================================\n");
332
        }
333
334
        return 1;
335
    }
336
337
    /**
338
     * Small tricks to allow us to lower verbosity between NORMAL and QUIET and have a decent writeln API, even with old SF versions