Code Duplication    Length = 12-14 lines in 3 locations

Command/MigrateCommand.php 1 location

@@ 310-323 (lines=14) @@
307
308
    protected function askForConfirmation(InputInterface $input, OutputInterface $output)
309
    {
310
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
311
            $dialog = $this->getHelperSet()->get('dialog');
312
            if (!$dialog->askConfirmation(
313
                $output,
314
                '<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>',
315
                false
316
            )
317
            ) {
318
                $output->writeln('<error>Migration execution cancelled!</error>');
319
                return 0;
320
            }
321
        } else {
322
            $this->writeln("=============================================\n");
323
        }
324
325
        return 1;
326
    }

Command/MigrationCommand.php 1 location

@@ 141-152 (lines=12) @@
138
        }
139
140
        // ask user for confirmation to make changes
141
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
142
            $dialog = $this->getHelperSet()->get('dialog');
143
            if (!$dialog->askConfirmation(
144
                $output,
145
                '<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>',
146
                false
147
            )
148
            ) {
149
                $output->writeln('<error>Migration change cancelled!</error>');
150
                return 0;
151
            }
152
        }
153
154
        if ($input->getOption('add')) {
155
            // will throw if a file is passed and it is not found, but not if an empty dir is passed

Command/ResumeCommand.php 1 location

@@ 80-91 (lines=12) @@
77
        }
78
79
        // ask user for confirmation to make changes
80
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
81
            $dialog = $this->getHelperSet()->get('dialog');
82
            if (!$dialog->askConfirmation(
83
                $output,
84
                '<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>',
85
                false
86
            )
87
            ) {
88
                $output->writeln('<error>Migration resuming cancelled!</error>');
89
                return 0;
90
            }
91
        }
92
93
        $executed = 0;
94
        $failed = 0;