Conditions | 4 |
Paths | 13 |
Total Lines | 24 |
Code Lines | 15 |
Lines | 24 |
Ratio | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | protected function execute(InputInterface $input, OutputInterface $output) |
||
27 | { |
||
28 | try { |
||
29 | $versionInfo = $this->migration->getCurrentVersion(); |
||
30 | if (strpos($versionInfo['status'], 'partial') !== false) { |
||
31 | $helper = $this->getHelper('question'); |
||
32 | $question = new ConfirmationQuestion( |
||
33 | 'The database was not fully updated and maybe be unstable. Did you really want migrate the version? (y/N)', |
||
34 | false |
||
35 | ); |
||
36 | |||
37 | if (!$helper->ask($input, $output, $question)) { |
||
38 | $output->writeln('Aborted.'); |
||
39 | |||
40 | return; |
||
41 | } |
||
42 | } |
||
43 | |||
44 | parent::execute($input, $output); |
||
45 | $this->migration->down($this->upTo, true); |
||
46 | } catch (\Exception $ex) { |
||
47 | $this->handleError($ex, $output); |
||
48 | } |
||
49 | } |
||
50 | |||
52 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.