Code Duplication    Length = 19-20 lines in 2 locations

Command/MassMigrateCommand.php 1 location

@@ 357-376 (lines=20) @@
354
            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
355
    }
356
357
    protected function askForConfirmation(InputInterface $input, OutputInterface $output)
358
    {
359
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
360
            $dialog = $this->getHelperSet()->get('question');
361
            if (!$dialog->ask(
362
                $input,
363
                $output,
364
                new ConfirmationQuestion('<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>', false)
365
            )
366
            ) {
367
                $output->writeln('<error>Migration execution cancelled!</error>');
368
                return 0;
369
            }
370
        } else {
371
            // this line is not that nice in the automated scenarios used by the parallel migration
372
            //$this->writeln("=============================================");
373
        }
374
375
        return 1;
376
    }
377
378
    /**
379
     * @param MigrationDefinition[] $toExecute

Command/MigrateCommand.php 1 location

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