Failed Conditions
Pull Request — master (#968)
by Edi
02:04
created

SyncMetadataCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 9
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations\Tools\Console\Command;
6
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
final class SyncMetadataCommand extends DoctrineCommand
11
{
12
    /** @var string */
13
    protected static $defaultName = 'migrations:sync-metadata-storage';
14
15
    protected function configure() : void
16
    {
17
        parent::configure();
18
19
        $this
20
            ->setAliases(['sync-metadata-storage'])
21
            ->setDescription('Ensures that the metadata storage is at the latest version.')
22
            ->setHelp(<<<EOT
23
The <info>%command.name%</info> command updates metadata storage the latest version.
24
25
    <info>%command.full_name%</info>
26
EOT
27
            );
28
    }
29
30
    public function execute(
31
        InputInterface $input,
32
        OutputInterface $output
33
    ) : int {
34
        $this->getDependencyFactory()->getMetadataStorage()->ensureInitialized();
35
36
        $this->io->success('Metadata storage synchronized');
37
38
        return 0;
39
    }
40
}
41