Conditions | 3 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3.1105 |
Changes | 0 |
1 | <?php |
||
29 | 1 | public function execute(InputInterface $input, OutputInterface $output) : ?int |
|
30 | { |
||
31 | 1 | $aliasResolver = $this->getDependencyFactory()->getVersionAliasResolver(); |
|
32 | |||
33 | try { |
||
34 | 1 | $version = $aliasResolver->resolveVersionAlias('latest'); |
|
35 | 1 | $availableMigration = $this->getDependencyFactory()->getMigrationRepository()->getMigration($version); |
|
36 | 1 | $description = $availableMigration->getMigration()->getDescription(); |
|
37 | } catch (NoMigrationsToExecute $e) { |
||
38 | $version = '0'; |
||
39 | $description = ''; |
||
40 | } |
||
41 | |||
42 | 1 | $output->writeln(sprintf( |
|
43 | 1 | '<info>%s</info>%s', |
|
44 | 1 | $version, |
|
45 | 1 | $description !== '' ? ' - ' . $description : '' |
|
46 | )); |
||
47 | |||
48 | 1 | return 0; |
|
49 | } |
||
51 |