Conditions | 3 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
33 | 4 | public function execute(InputInterface $input, OutputInterface $output) |
|
34 | { |
||
35 | 4 | $configuration = $this->getMigrationConfiguration($input, $output); |
|
36 | |||
37 | 4 | $migrations = count($configuration->getMigrations()); |
|
38 | 4 | $migratedVersions = count($configuration->getMigratedVersions()); |
|
39 | 4 | $availableMigrations = $migrations - $migratedVersions; |
|
40 | |||
41 | 4 | if ($availableMigrations === 0) { |
|
42 | 2 | $output->writeln('<comment>Up-to-date! No migrations to execute.</comment>'); |
|
43 | 2 | return 0; |
|
44 | } |
||
45 | |||
46 | 2 | $output->writeln(sprintf( |
|
47 | 2 | '<comment>Out-of-date! %u migration%s available to execute.</comment>', |
|
48 | 2 | $availableMigrations, |
|
49 | 2 | $availableMigrations > 1 ? 's are' : ' is' |
|
50 | 2 | )); |
|
51 | 2 | return 1; |
|
52 | } |
||
53 | } |
||
54 |