Code Duplication    Length = 12-14 lines in 2 locations

Command/MigrationCommand.php 1 location

@@ 61-72 (lines=12) @@
58
        $migrationNameOrPath = $input->getArgument('migration');
59
60
        // ask user for confirmation to make changes
61
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
62
            $dialog = $this->getHelperSet()->get('dialog');
63
            if (!$dialog->askConfirmation(
64
                $output,
65
                '<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>',
66
                false
67
            )
68
            ) {
69
                $output->writeln('<error>Migration change cancelled!</error>');
70
                return 0;
71
            }
72
        }
73
74
        if ($input->getOption('add')) {
75
            // will throw if a file is passed and it is not found, but not if an empty dir is passed

Command/MigrateCommand.php 1 location

@@ 294-307 (lines=14) @@
291
292
    protected function askForConfirmation(InputInterface $input, OutputInterface $output)
293
    {
294
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
295
            $dialog = $this->getHelperSet()->get('dialog');
296
            if (!$dialog->askConfirmation(
297
                $output,
298
                '<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>',
299
                false
300
            )
301
            ) {
302
                $output->writeln('<error>Migration execution cancelled!</error>');
303
                return 0;
304
            }
305
        } else {
306
            $this->writeln("=============================================\n");
307
        }
308
309
        return 1;
310
    }