Conditions | 4 |
Paths | 6 |
Total Lines | 26 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
18 | protected function execute(InputInterface $input, OutputInterface $output) |
||
19 | { |
||
20 | // drop cached schema |
||
21 | $this->cycleOrmHelper->dropCurrentSchemaCache(); |
||
22 | |||
23 | $this->findMigrations($output); |
||
24 | |||
25 | $limit = PHP_INT_MAX; |
||
26 | try { |
||
27 | do { |
||
28 | $migration = $this->migrator->run(); |
||
29 | if (!$migration instanceof MigrationInterface) { |
||
30 | break; |
||
31 | } |
||
32 | |||
33 | $state = $migration->getState(); |
||
34 | $status = $state->getStatus(); |
||
35 | $output->writeln('<fg=cyan>' . $state->getName() . '</>: ' |
||
36 | . (static::$migrationStatus[$status] ?? $status)); |
||
37 | } while (--$limit > 0); |
||
38 | } catch (\Throwable $e) { |
||
39 | $output->writeln([ |
||
40 | '<fg=red>Error!</>', |
||
41 | $e->getMessage(), |
||
42 | ]); |
||
43 | return; |
||
44 | } |
||
47 |